From 10b15c4d32bbca11c493df3da01776f85081ce74 Mon Sep 17 00:00:00 2001
From: Jan Helke <typo3@helke.de>
Date: Sat, 17 Mar 2018 10:20:39 +0100
Subject: [PATCH] [TASK] Make sysext/form/Tests/Unit/Mvc/ notice free

Releases: master
Resolves: #84401
Change-Id: I59cd08acbae46abb5da0202bd719857594aa9439
Reviewed-on: https://review.typo3.org/56276
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>
---
 .../Property/PropertyMappingConfiguration.php |  2 +-
 .../InheritancesResolverServiceTest.php       | 27 +++----
 .../FormPersistenceManagerTest.php            | 75 +++++++++----------
 .../PropertyMappingConfigurationTest.php      | 37 +++++----
 .../Mvc/Validation/MimeTypeValidatorTest.php  |  2 +-
 5 files changed, 74 insertions(+), 69 deletions(-)

diff --git a/typo3/sysext/form/Classes/Mvc/Property/PropertyMappingConfiguration.php b/typo3/sysext/form/Classes/Mvc/Property/PropertyMappingConfiguration.php
index 9e5188b53407..bc4fc0da14b9 100644
--- a/typo3/sysext/form/Classes/Mvc/Property/PropertyMappingConfiguration.php
+++ b/typo3/sysext/form/Classes/Mvc/Property/PropertyMappingConfiguration.php
@@ -56,7 +56,7 @@ class PropertyMappingConfiguration
 
             $allowedMimeTypes = [];
             $validators = [];
-            if (is_array($renderable->getProperties()['allowedMimeTypes'])) {
+            if (isset($renderable->getProperties()['allowedMimeTypes']) && \is_array($renderable->getProperties()['allowedMimeTypes'])) {
                 $allowedMimeTypes = array_filter($renderable->getProperties()['allowedMimeTypes']);
             }
             if (!empty($allowedMimeTypes)) {
diff --git a/typo3/sysext/form/Tests/Unit/Mvc/Configuration/InheritancesResolverServiceTest.php b/typo3/sysext/form/Tests/Unit/Mvc/Configuration/InheritancesResolverServiceTest.php
index 9717db4b21e6..4a7de0b257dd 100644
--- a/typo3/sysext/form/Tests/Unit/Mvc/Configuration/InheritancesResolverServiceTest.php
+++ b/typo3/sysext/form/Tests/Unit/Mvc/Configuration/InheritancesResolverServiceTest.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Form\Tests\Unit\Mvc\Configuration;
 
 /*
@@ -16,17 +17,13 @@ namespace TYPO3\CMS\Form\Tests\Unit\Mvc\Configuration;
 
 use TYPO3\CMS\Form\Mvc\Configuration\Exception\CycleInheritancesException;
 use TYPO3\CMS\Form\Mvc\Configuration\InheritancesResolverService;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Test case
  */
-class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class InheritancesResolverServiceTest extends UnitTestCase
 {
-    /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
     /**
      * @var InheritancesResolverService
      */
@@ -41,7 +38,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
      * @test
      * Test for the explicit example in service class comment
      */
-    public function getDocExampleInheritance()
+    public function getDocExampleInheritance(): void
     {
         $input = [
             'Form' => [
@@ -80,7 +77,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
     /**
      * @test
      */
-    public function getMergedConfigurationSimpleInheritance()
+    public function getMergedConfigurationSimpleInheritance(): void
     {
         $input = [
             'Form' => [
@@ -121,7 +118,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
     /**
      * @test
      */
-    public function getMergedConfigurationSimpleInheritanceOverrideValue()
+    public function getMergedConfigurationSimpleInheritanceOverrideValue(): void
     {
         $input = [
             'Form' => [
@@ -154,7 +151,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
     /**
      * @test
      */
-    public function getMergedConfigurationSimpleInheritanceRemoveValue()
+    public function getMergedConfigurationSimpleInheritanceRemoveValue(): void
     {
         $input = [
             'Form' => [
@@ -219,7 +216,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
     /**
      * @test
      */
-    public function getMergedConfigurationSimpleMixin()
+    public function getMergedConfigurationSimpleMixin(): void
     {
         $input = [
             'Form' => [
@@ -263,7 +260,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
     /**
      * @test
      */
-    public function getMergedConfigurationAdvancedMixin()
+    public function getMergedConfigurationAdvancedMixin(): void
     {
         $input = [
             'Form' => [
@@ -356,7 +353,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
     /**
      * @test
      */
-    public function getResolvedConfigurationThrowsExceptionIfCycleDepenciesOnSameLevelIsFound()
+    public function getResolvedConfigurationThrowsExceptionIfCycleDepenciesOnSameLevelIsFound(): void
     {
         $input = [
             'TYPO3' => [
@@ -386,7 +383,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
     /**
      * @test
      */
-    public function getResolvedConfigurationThrowsExceptionIfCycleDepenciesOnSameLevelWithGapIsFound()
+    public function getResolvedConfigurationThrowsExceptionIfCycleDepenciesOnSameLevelWithGapIsFound(): void
     {
         $input = [
             'TYPO3' => [
@@ -426,7 +423,7 @@ class InheritancesResolverServiceTest extends \TYPO3\TestingFramework\Core\Unit\
     /**
      * @test
      */
-    public function getResolvedConfigurationThrowsExceptionIfCycleDepenciesOnHigherLevelIsFound()
+    public function getResolvedConfigurationThrowsExceptionIfCycleDepenciesOnHigherLevelIsFound(): void
     {
         $input = [
             'TYPO3' => [
diff --git a/typo3/sysext/form/Tests/Unit/Mvc/Persistence/FormPersistenceManagerTest.php b/typo3/sysext/form/Tests/Unit/Mvc/Persistence/FormPersistenceManagerTest.php
index d26ab5276499..dacb67224f30 100644
--- a/typo3/sysext/form/Tests/Unit/Mvc/Persistence/FormPersistenceManagerTest.php
+++ b/typo3/sysext/form/Tests/Unit/Mvc/Persistence/FormPersistenceManagerTest.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Form\Tests\Unit\Mvc\Persistence;
 
 /*
@@ -20,21 +21,17 @@ use TYPO3\CMS\Core\Resource\StorageRepository;
 use TYPO3\CMS\Form\Mvc\Persistence\Exception\NoUniqueIdentifierException;
 use TYPO3\CMS\Form\Mvc\Persistence\Exception\PersistenceManagerException;
 use TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManager;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Test case
  */
-class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class FormPersistenceManagerTest extends UnitTestCase
 {
-    /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
     /**
      * @test
      */
-    public function loadThrowsExceptionIfPersistenceIdentifierHasNoYamlExtension()
+    public function loadThrowsExceptionIfPersistenceIdentifierHasNoYamlExtension(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1477679819);
@@ -50,7 +47,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function loadThrowsExceptionIfPersistenceIdentifierIsAExtensionLocationWhichIsNotAllowed()
+    public function loadThrowsExceptionIfPersistenceIdentifierIsAExtensionLocationWhichIsNotAllowed(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1484071985);
@@ -72,7 +69,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function saveThrowsExceptionIfPersistenceIdentifierHasNoYamlExtension()
+    public function saveThrowsExceptionIfPersistenceIdentifierHasNoYamlExtension(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1477679820);
@@ -88,7 +85,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function saveThrowsExceptionIfPersistenceIdentifierIsAExtensionLocationAndSaveToExtensionLocationIsNotAllowed()
+    public function saveThrowsExceptionIfPersistenceIdentifierIsAExtensionLocationAndSaveToExtensionLocationIsNotAllowed(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1477680881);
@@ -110,7 +107,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function saveThrowsExceptionIfPersistenceIdentifierIsAExtensionLocationWhichIsNotAllowed()
+    public function saveThrowsExceptionIfPersistenceIdentifierIsAExtensionLocationWhichIsNotAllowed(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1484073571);
@@ -133,7 +130,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function deleteThrowsExceptionIfPersistenceIdentifierHasNoYamlExtension()
+    public function deleteThrowsExceptionIfPersistenceIdentifierHasNoYamlExtension(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1472239534);
@@ -149,7 +146,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function deleteThrowsExceptionIfPersistenceIdentifierFileDoesNotExists()
+    public function deleteThrowsExceptionIfPersistenceIdentifierFileDoesNotExists(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1472239535);
@@ -170,7 +167,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function deleteThrowsExceptionIfPersistenceIdentifierIsExtensionLocationAndDeleteFromExtensionLocationsIsNotAllowed()
+    public function deleteThrowsExceptionIfPersistenceIdentifierIsExtensionLocationAndDeleteFromExtensionLocationsIsNotAllowed(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1472239536);
@@ -197,7 +194,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function deleteThrowsExceptionIfPersistenceIdentifierIsExtensionLocationWhichIsNotAllowed()
+    public function deleteThrowsExceptionIfPersistenceIdentifierIsExtensionLocationWhichIsNotAllowed(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1484073878);
@@ -225,7 +222,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function deleteThrowsExceptionIfPersistenceIdentifierIsStorageLocationAndDeleteFromStorageIsNotAllowed()
+    public function deleteThrowsExceptionIfPersistenceIdentifierIsStorageLocationAndDeleteFromStorageIsNotAllowed(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1472239516);
@@ -244,7 +241,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
             ->method('checkFileActionPermission')
             ->willReturn(false);
 
-        $file = new File(['identifier' => '', 'mime_type' => ''], $mockStorage);
+        $file = new File(['name' => 'foo', 'identifier' => '', 'mime_type' => ''], $mockStorage);
         $mockStorage
             ->expects($this->any())
             ->method('getFile')
@@ -267,7 +264,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function existsReturnsTrueIfPersistenceIdentifierIsExtensionLocationAndFileExistsAndFileHasYamlExtension()
+    public function existsReturnsTrueIfPersistenceIdentifierIsExtensionLocationAndFileExistsAndFileHasYamlExtension(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'dummy'
@@ -288,7 +285,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function existsReturnsFalseIfPersistenceIdentifierIsExtensionLocationAndFileExistsAndFileHasNoYamlExtension()
+    public function existsReturnsFalseIfPersistenceIdentifierIsExtensionLocationAndFileExistsAndFileHasNoYamlExtension(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'dummy'
@@ -301,7 +298,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function existsReturnsFalseIfPersistenceIdentifierIsExtensionLocationAndFileExistsAndExtensionLocationIsNotAllowed()
+    public function existsReturnsFalseIfPersistenceIdentifierIsExtensionLocationAndFileExistsAndExtensionLocationIsNotAllowed(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'dummy'
@@ -320,7 +317,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function existsReturnsFalseIfPersistenceIdentifierIsExtensionLocationAndFileNotExistsAndFileHasYamlExtension()
+    public function existsReturnsFalseIfPersistenceIdentifierIsExtensionLocationAndFileNotExistsAndFileHasYamlExtension(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'dummy'
@@ -333,7 +330,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function existsReturnsTrueIfPersistenceIdentifierIsStorageLocationAndFileExistsAndFileHasYamlExtension()
+    public function existsReturnsTrueIfPersistenceIdentifierIsStorageLocationAndFileExistsAndFileHasYamlExtension(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'getStorageByUid'
@@ -359,7 +356,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function existsReturnsFalseIfPersistenceIdentifierIsStorageLocationAndFileExistsAndFileNoYamlExtension()
+    public function existsReturnsFalseIfPersistenceIdentifierIsStorageLocationAndFileExistsAndFileNoYamlExtension(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'getStorageByUid'
@@ -385,7 +382,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function existsReturnsFalseIfPersistenceIdentifierIsStorageLocationAndFileNotExistsAndFileHasYamlExtension()
+    public function existsReturnsFalseIfPersistenceIdentifierIsStorageLocationAndFileNotExistsAndFileHasYamlExtension(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'getStorageByUid'
@@ -411,7 +408,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getUniquePersistenceIdentifierAppendNumberIfPersistenceIdentifierExists()
+    public function getUniquePersistenceIdentifierAppendNumberIfPersistenceIdentifierExists(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'exists'
@@ -440,7 +437,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getUniquePersistenceIdentifierAppendTimestampIfPersistenceIdentifierExists()
+    public function getUniquePersistenceIdentifierAppendTimestampIfPersistenceIdentifierExists(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'exists'
@@ -468,7 +465,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getUniqueIdentifierThrowsExceptionIfIdentifierExists()
+    public function getUniqueIdentifierThrowsExceptionIfIdentifierExists(): void
     {
         $this->expectException(NoUniqueIdentifierException::class);
         $this->expectExceptionCode(1477688567);
@@ -489,7 +486,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getUniqueIdentifierAppendTimestampIfIdentifierExists()
+    public function getUniqueIdentifierAppendTimestampIfIdentifierExists(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'checkForDuplicateIdentifier'
@@ -517,14 +514,14 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function checkForDuplicateIdentifierReturnsTrueIfIdentifierIsUsed()
+    public function checkForDuplicateIdentifierReturnsTrueIfIdentifierIsUsed(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'listForms'
         ], [], '', false);
 
         $mockFormPersistenceManager
-            ->expects($this->at($attempts))
+            ->expects($this->at(null))
             ->method('listForms')
             ->willReturn([
                 0 => [
@@ -539,14 +536,14 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function checkForDuplicateIdentifierReturnsFalseIfIdentifierIsUsed()
+    public function checkForDuplicateIdentifierReturnsFalseIfIdentifierIsUsed(): void
     {
         $mockFormPersistenceManager = $this->getAccessibleMock(FormPersistenceManager::class, [
             'listForms'
         ], [], '', false);
 
         $mockFormPersistenceManager
-            ->expects($this->at($attempts))
+            ->expects($this->at(null))
             ->method('listForms')
             ->willReturn([
                 0 => [
@@ -561,7 +558,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getFileByIdentifierThrowsExceptionIfReadFromStorageIsNotAllowed()
+    public function getFileByIdentifierThrowsExceptionIfReadFromStorageIsNotAllowed(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1471630578);
@@ -579,7 +576,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
             ->method('checkFileActionPermission')
             ->willReturn(false);
 
-        $file = new File(['identifier' => '', 'mime_type' => ''], $mockStorage);
+        $file = new File(['name' => 'foo', 'identifier' => '', 'mime_type' => ''], $mockStorage);
         $mockStorage
             ->expects($this->any())
             ->method('getFile')
@@ -597,7 +594,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getOrCreateFileThrowsExceptionIfFolderNotExistsInStorage()
+    public function getOrCreateFileThrowsExceptionIfFolderNotExistsInStorage(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1471630579);
@@ -627,7 +624,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getOrCreateFileThrowsExceptionIfWriteToStorageIsNotAllowed()
+    public function getOrCreateFileThrowsExceptionIfWriteToStorageIsNotAllowed(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1471630580);
@@ -650,7 +647,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
             ->method('checkFileActionPermission')
             ->willReturn(false);
 
-        $file = new File(['identifier' => '', 'mime_type' => ''], $mockStorage);
+        $file = new File(['name' => 'foo', 'identifier' => '', 'mime_type' => ''], $mockStorage);
         $mockStorage
             ->expects($this->any())
             ->method('getFile')
@@ -668,7 +665,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getStorageByUidThrowsExceptionIfStorageNotExists()
+    public function getStorageByUidThrowsExceptionIfStorageNotExists(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1471630581);
@@ -693,7 +690,7 @@ class FormPersistenceManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitT
     /**
      * @test
      */
-    public function getStorageByUidThrowsExceptionIfStorageIsNotBrowsable()
+    public function getStorageByUidThrowsExceptionIfStorageIsNotBrowsable(): void
     {
         $this->expectException(PersistenceManagerException::class);
         $this->expectExceptionCode(1471630581);
diff --git a/typo3/sysext/form/Tests/Unit/Mvc/Property/PropertyMappingConfigurationTest.php b/typo3/sysext/form/Tests/Unit/Mvc/Property/PropertyMappingConfigurationTest.php
index 4f4c93c118bf..525d108576be 100644
--- a/typo3/sysext/form/Tests/Unit/Mvc/Property/PropertyMappingConfigurationTest.php
+++ b/typo3/sysext/form/Tests/Unit/Mvc/Property/PropertyMappingConfigurationTest.php
@@ -2,6 +2,19 @@
 declare(strict_types = 1);
 namespace TYPO3\CMS\Form\Mvc\Property;
 
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
@@ -15,13 +28,11 @@ use TYPO3\CMS\Form\Mvc\Property\TypeConverter\UploadedFileReferenceConverter;
 use TYPO3\CMS\Form\Mvc\Validation\MimeTypeValidator;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
+/**
+ * Test case
+ */
 class PropertyMappingConfigurationTest extends UnitTestCase
 {
-    /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
     /** @var PropertyMappingConfiguration */
     protected $propertyMappingConfiguration;
 
@@ -91,7 +102,7 @@ class PropertyMappingConfigurationTest extends UnitTestCase
         $this->propertyMappingConfiguration = new PropertyMappingConfiguration();
     }
 
-    public function tearDown()
+    public function tearDown(): void
     {
         // Remove all singleton instances
         GeneralUtility::resetSingletonInstances($this->singletons);
@@ -102,7 +113,7 @@ class PropertyMappingConfigurationTest extends UnitTestCase
      * A bare minimum test that checks if the function maybe potentially works.
      * @test
      */
-    public function afterBuildingFinishedAddsFileReferenceConverter()
+    public function afterBuildingFinishedAddsFileReferenceConverter(): void
     {
         // Mime Type Validator
         /** @var \PHPUnit_Framework_MockObject_MockObject|MimeTypeValidator $mimeTypeValidator */
@@ -153,7 +164,7 @@ class PropertyMappingConfigurationTest extends UnitTestCase
     /**
      * @test
      */
-    public function afterBuildingFinishedAddsMimeTypeConverter()
+    public function afterBuildingFinishedAddsMimeTypeConverter(): void
     {
         $mimeTypes = ['allowedMimeTypes' => ['text/plain', 'application/x-www-form-urlencoded']];
 
@@ -208,7 +219,7 @@ class PropertyMappingConfigurationTest extends UnitTestCase
     /**
      * @test
      */
-    public function afterBuildingFinishedSetsUpStoragePathToPropertySaveToFileMountIfItExists()
+    public function afterBuildingFinishedSetsUpStoragePathToPropertySaveToFileMountIfItExists(): void
     {
         // Mime Type Validator
         /** @var \PHPUnit_Framework_MockObject_MockObject|MimeTypeValidator $mimeTypeValidator */
@@ -264,7 +275,7 @@ class PropertyMappingConfigurationTest extends UnitTestCase
     /**
      * @test
      */
-    public function afterBuildingFinishedSetsUpStoragePathToToFormDefinitionPathIfSaveToFileMountIsNotDefinedAndFormWasNotAddedProgrammatically()
+    public function afterBuildingFinishedSetsUpStoragePathToToFormDefinitionPathIfSaveToFileMountIsNotDefinedAndFormWasNotAddedProgrammatically(): void
     {
         // Mime Type Validator
         /** @var \PHPUnit_Framework_MockObject_MockObject|MimeTypeValidator $mimeTypeValidator */
@@ -325,7 +336,7 @@ class PropertyMappingConfigurationTest extends UnitTestCase
     /**
      * @test
      */
-    public function afterBuildingFinishedSetsStoragePathToUserUploadIfNeitherSaveToFileMountIsSetNorThereIsAFormDefinitionPath()
+    public function afterBuildingFinishedSetsStoragePathToUserUploadIfNeitherSaveToFileMountIsSetNorThereIsAFormDefinitionPath(): void
     {
         // Mime Type Validator
         /** @var \PHPUnit_Framework_MockObject_MockObject|MimeTypeValidator $mimeTypeValidator */
@@ -383,7 +394,7 @@ class PropertyMappingConfigurationTest extends UnitTestCase
     /**
      * @test
      */
-    public function afterBuildingFinishedCopiesValidators()
+    public function afterBuildingFinishedCopiesValidators(): void
     {
         // Mime Type Validator
         /** @var \PHPUnit_Framework_MockObject_MockObject|MimeTypeValidator $mimeTypeValidator */
@@ -439,7 +450,7 @@ class PropertyMappingConfigurationTest extends UnitTestCase
     /**
      * @test
      */
-    public function afterBuildingFinishedDoesNotCopyNotEmptyValidator()
+    public function afterBuildingFinishedDoesNotCopyNotEmptyValidator(): void
     {
         // Mime Type Validator
         /** @var \PHPUnit_Framework_MockObject_MockObject|MimeTypeValidator $mimeTypeValidator */
diff --git a/typo3/sysext/form/Tests/Unit/Mvc/Validation/MimeTypeValidatorTest.php b/typo3/sysext/form/Tests/Unit/Mvc/Validation/MimeTypeValidatorTest.php
index f8dbaa19eff4..09d234247d69 100644
--- a/typo3/sysext/form/Tests/Unit/Mvc/Validation/MimeTypeValidatorTest.php
+++ b/typo3/sysext/form/Tests/Unit/Mvc/Validation/MimeTypeValidatorTest.php
@@ -75,7 +75,7 @@ class MimeTypeValidatorTest extends UnitTestCase
             ->disableOriginalConstructor()
             ->getMock();
 
-        $file = new File(['identifier' => '/foo', 'mime_type' => 'image/png'], $mockedStorage);
+        $file = new File(['name' => 'foo', 'identifier' => '/foo', 'mime_type' => 'image/png'], $mockedStorage);
         $this->assertTrue($validator->validate($file)->hasErrors());
     }
 
-- 
GitLab