‪TYPO3CMS  9.5
EmConfUtilityTest.php
Go to the documentation of this file.
1 <?php
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 use TYPO3\CMS\Extensionmanager\Utility\EmConfUtility;
18 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
19 
23 class ‪EmConfUtilityTest extends UnitTestCase
24 {
25 
30  {
31  $extensionData = [
32  'extKey' => 'key',
33  'EM_CONF' => [],
34  ];
35  $fixture = new EmConfUtility();
36  $emConf = $fixture->constructEmConf($extensionData);
37  $this->assertContains('Extension Manager/Repository config file for ext', $emConf);
38  }
39 
44  {
45  $input = [
46  'title' => 'a title',
47  'conflicts' => 'foo',
48  ];
49  $expected = [
50  'title' => 'a title',
51  'constraints' => [
52  'depends' => [],
53  'conflicts' => [
54  'foo' => '',
55  ],
56  'suggests' => [],
57  ],
58  ];
59  $fixture = new EmConfUtility();
60  $this->assertEquals($expected, $fixture->fixEmConf($input));
61  }
62 
67  {
68  $input = [
69  'title' => 'a title',
70  'conflicts' => 'foo,bar',
71  ];
72  $expected = [
73  'title' => 'a title',
74  'constraints' => [
75  'depends' => [],
76  'conflicts' => [
77  'foo' => '',
78  'bar' => '',
79  ],
80  'suggests' => [],
81  ],
82  ];
83  $fixture = new EmConfUtility();
84  $this->assertEquals($expected, $fixture->fixEmConf($input));
85  }
86 }
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\EmConfUtilityTest
Definition: EmConfUtilityTest.php:24
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility
Definition: DependencyUtilityTest.php:2
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\EmConfUtilityTest\constructEmConfAddsCommentBlock
‪constructEmConfAddsCommentBlock()
Definition: EmConfUtilityTest.php:29
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\EmConfUtilityTest\fixEmConfTransfersOldConflictSettingToNewFormatWithSingleConflictingExtension
‪fixEmConfTransfersOldConflictSettingToNewFormatWithSingleConflictingExtension()
Definition: EmConfUtilityTest.php:43
‪TYPO3\CMS\Extensionmanager\Tests\Unit\Utility\EmConfUtilityTest\fixEmConfTransfersOldConflictSettingToNewFormatWithTwoConflictingExtensions
‪fixEmConfTransfersOldConflictSettingToNewFormatWithTwoConflictingExtensions()
Definition: EmConfUtilityTest.php:66