[TASK] Remove unused EM_CONF variables
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Tests / Unit / Utility / EmConfUtilityTest.php
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\Tests\Unit\Utility;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Test case
19 */
20 class EmConfUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
21
22 /**
23 * @test
24 */
25 public function constructEmConfAddsCommentBlock() {
26 $extensionData = array(
27 'extKey' => 'key',
28 'EM_CONF' => array(),
29 );
30 $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
31 $emConf = $fixture->constructEmConf($extensionData);
32 $this->assertContains('Extension Manager/Repository config file for ext', $emConf);
33 }
34
35 /**
36 * @test
37 */
38 public function fixEmConfTransfersOldConflictSettingToNewFormatWithSingleConflictingExtension() {
39 $input = array(
40 'title' => 'a title',
41 'conflicts' => 'foo',
42 );
43 $expected = array(
44 'title' => 'a title',
45 'constraints' => array(
46 'depends' => array(),
47 'conflicts' => array(
48 'foo' => '',
49 ),
50 'suggests' => array(),
51 ),
52 );
53 $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
54 $this->assertEquals($expected, $fixture->fixEmConf($input));
55 }
56
57 /**
58 * @test
59 */
60 public function fixEmConfTransfersOldConflictSettingToNewFormatWithTwoConflictingExtensions() {
61 $input = array(
62 'title' => 'a title',
63 'conflicts' => 'foo,bar',
64 );
65 $expected = array(
66 'title' => 'a title',
67 'constraints' => array(
68 'depends' => array(),
69 'conflicts' => array(
70 'foo' => '',
71 'bar' => '',
72 ),
73 'suggests' => array(),
74 ),
75 );
76 $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
77 $this->assertEquals($expected, $fixture->fixEmConf($input));
78 }
79 }