[TASK] Make AbstractFileTest notice free 79/56279/2
authorŁukasz Uznański <l.uznanski@macopedia.pl>
Sat, 17 Mar 2018 09:59:29 +0000 (10:59 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 17 Mar 2018 10:51:06 +0000 (11:51 +0100)
Resolves: #84403
Releases: master
Change-Id: Ib65619324c725bc43abf7309d1c48cab7a7d7f4d
Reviewed-on: https://review.typo3.org/56279
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: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Resource/File.php
typo3/sysext/core/Tests/Unit/Resource/AbstractFileTest.php

index f5e927f..299789e 100644 (file)
@@ -57,7 +57,7 @@ class File extends AbstractFile
     public function __construct(array $fileData, ResourceStorage $storage, array $metaData = [])
     {
         $this->identifier = $fileData['identifier'];
-        $this->name = $fileData['name'];
+        $this->name = $fileData['name'] ?? '';
         $this->properties = $fileData;
         $this->storage = $storage;
         if (!empty($metaData)) {
index fdaa4b5..04ebfbe 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Core\Tests\Unit\Resource;
 
 /*
@@ -17,21 +18,17 @@ namespace TYPO3\CMS\Core\Tests\Unit\Resource;
 use TYPO3\CMS\Core\Resource\AbstractFile;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\ResourceStorage;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Testcase for the abstract file class of the TYPO3 FAL
  */
-class AbstractFileTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class AbstractFileTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @test
      */
-    public function getParentFolderGetsParentFolderFromStorage()
+    public function getParentFolderGetsParentFolderFromStorage(): void
     {
         $parentIdentifier = '/parent/';
         $currentIdentifier = '/parent/current/';
@@ -66,7 +63,7 @@ class AbstractFileTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
      *
      * @test
      */
-    public function storageIsNotAskedForMimeTypeForPersistedRecord()
+    public function storageIsNotAskedForMimeTypeForPersistedRecord(): void
     {
         /** @var ResourceStorage|\PHPUnit_Framework_MockObject_MockObject $mockedStorage */
         $mockedStorage = $this->getMockBuilder(ResourceStorage::class)->disableOriginalConstructor()->getMock();