[TASK] Make EmConfUtilityTest notice free 59/56259/2
authorJan Helke <typo3@helke.de>
Fri, 16 Mar 2018 21:16:47 +0000 (22:16 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 16 Mar 2018 21:46:49 +0000 (22:46 +0100)
Releases: master
Resolves: #84381
Change-Id: I56332d89f4c98643bbf24df5b811ae54731e5dac
Reviewed-on: https://review.typo3.org/56259
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extensionmanager/Classes/Utility/EmConfUtility.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/EmConfUtilityTest.php

index 2d12496..4b6295f 100644 (file)
@@ -86,16 +86,16 @@ $EM_CONF[$_EXTKEY] = ' . $emConf . ';
             || !isset($emConf['constraints']['conflicts']) || !isset($emConf['constraints']['suggests'])
         ) {
             if (!isset($emConf['constraints']) || !isset($emConf['constraints']['depends'])) {
-                $emConf['constraints']['depends'] = $this->stringToDependency($emConf['dependencies']);
-                if ((string)$emConf['PHP_version'] !== '') {
+                $emConf['constraints']['depends'] = $this->stringToDependency($emConf['dependencies'] ?? '');
+                if (isset($emConf['PHP_version']) && (string)$emConf['PHP_version'] !== '') {
                     $emConf['constraints']['depends']['php'] = $emConf['PHP_version'];
                 }
-                if ((string)$emConf['TYPO3_version'] !== '') {
+                if (isset($emConf['TYPO3_version']) && (string)$emConf['TYPO3_version'] !== '') {
                     $emConf['constraints']['depends']['typo3'] = $emConf['TYPO3_version'];
                 }
             }
             if (!isset($emConf['constraints']) || !isset($emConf['constraints']['conflicts'])) {
-                $emConf['constraints']['conflicts'] = $this->stringToDependency($emConf['conflicts']);
+                $emConf['constraints']['conflicts'] = $this->stringToDependency($emConf['conflicts'] ?? '');
             }
             if (!isset($emConf['constraints']) || !isset($emConf['constraints']['suggests'])) {
                 $emConf['constraints']['suggests'] = [];
index 2d9ee24..5b98cca 100644 (file)
@@ -14,15 +14,14 @@ namespace TYPO3\CMS\Extensionmanager\Tests\Unit\Utility;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extensionmanager\Utility\EmConfUtility;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
+
 /**
  * Test case
  */
-class EmConfUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class EmConfUtilityTest extends UnitTestCase
 {
-    /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
 
     /**
      * @test
@@ -33,7 +32,7 @@ class EmConfUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             'extKey' => 'key',
             'EM_CONF' => [],
         ];
-        $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
+        $fixture = new EmConfUtility();
         $emConf = $fixture->constructEmConf($extensionData);
         $this->assertContains('Extension Manager/Repository config file for ext', $emConf);
     }
@@ -57,7 +56,7 @@ class EmConfUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
                 'suggests' => [],
             ],
         ];
-        $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
+        $fixture = new EmConfUtility();
         $this->assertEquals($expected, $fixture->fixEmConf($input));
     }
 
@@ -81,7 +80,7 @@ class EmConfUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
                 'suggests' => [],
             ],
         ];
-        $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
+        $fixture = new EmConfUtility();
         $this->assertEquals($expected, $fixture->fixEmConf($input));
     }
 }