[TASK] Make ExtensionManagementUtilityTest notice free 07/57907/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 14 Aug 2018 23:21:29 +0000 (01:21 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 15 Aug 2018 05:49:32 +0000 (07:49 +0200)
Resolves: #85855
Releases: master
Change-Id: I85991ab3f999760eba0d6c5c918fd8b9c4fdce3d
Reviewed-on: https://review.typo3.org/57907
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Tests/Unit/Utility/ExtensionManagementUtilityTest.php

index c6af44f..fa8860f 100644 (file)
@@ -513,7 +513,9 @@ class ExtensionManagementUtility
         if ($relativePosition !== '' && $relativePosition !== 'before' && $relativePosition !== 'after' && $relativePosition !== 'replace') {
             throw new \InvalidArgumentException('Relative position must be either empty or one of "before", "after", "replace".', 1303236967);
         }
-        if (!is_array($GLOBALS['TCA'][$table]['columns'][$field]['config']['items'])) {
+        if (!isset($GLOBALS['TCA'][$table]['columns'][$field]['config']['items'])
+            || !is_array($GLOBALS['TCA'][$table]['columns'][$field]['config']['items'])
+        ) {
             throw new \RuntimeException('Given select field item list was not found.', 1303237468);
         }
         // Make sure item keys are integers
@@ -1234,7 +1236,9 @@ class ExtensionManagementUtility
                 1404068038
             );
         }
-        if (!$itemArray[2] && isset($GLOBALS['TYPO3_LOADED_EXT'][$extensionKey]['ext_icon'])) {
+        if ((!isset($itemArray[2]) || !$itemArray[2])
+            && isset($GLOBALS['TYPO3_LOADED_EXT'][$extensionKey]['ext_icon'])
+        ) {
             $itemArray[2] = 'EXT:' . $extensionKey . '/' . $GLOBALS['TYPO3_LOADED_EXT'][$extensionKey]['ext_icon'];
         }
         if (is_array($GLOBALS['TCA']['tt_content']['columns']) && is_array($GLOBALS['TCA']['tt_content']['columns'][$type]['config']['items'])) {
index 6e1f83c..9ca28ab 100644 (file)
@@ -33,11 +33,6 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 class ExtensionManagementUtilityTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @var bool Reset singletons created by subject
      */
     protected $resetSingletonInstances = true;