Skip to content

Commit

Permalink
[TASK] Make EmConfUtilityTest notice free
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
janhelke authored and lolli42 committed Mar 16, 2018
1 parent e92fd59 commit c6a4e85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Expand Up @@ -86,16 +86,16 @@ public function fixEmConf(array $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'] = [];
Expand Down
Expand Up @@ -14,15 +14,14 @@
* 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
Expand All @@ -33,7 +32,7 @@ public function constructEmConfAddsCommentBlock()
'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);
}
Expand All @@ -57,7 +56,7 @@ public function fixEmConfTransfersOldConflictSettingToNewFormatWithSingleConflic
'suggests' => [],
],
];
$fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
$fixture = new EmConfUtility();
$this->assertEquals($expected, $fixture->fixEmConf($input));
}

Expand All @@ -81,7 +80,7 @@ public function fixEmConfTransfersOldConflictSettingToNewFormatWithTwoConflictin
'suggests' => [],
],
];
$fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
$fixture = new EmConfUtility();
$this->assertEquals($expected, $fixture->fixEmConf($input));
}
}

0 comments on commit c6a4e85

Please sign in to comment.