TYPO3 CMS  TYPO3_7-6
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 
21 {
26  {
27  $extensionData = [
28  'extKey' => 'key',
29  'EM_CONF' => [],
30  ];
31  $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
32  $emConf = $fixture->constructEmConf($extensionData);
33  $this->assertContains('Extension Manager/Repository config file for ext', $emConf);
34  }
35 
40  {
41  $input = [
42  'title' => 'a title',
43  'conflicts' => 'foo',
44  ];
45  $expected = [
46  'title' => 'a title',
47  'constraints' => [
48  'depends' => [],
49  'conflicts' => [
50  'foo' => '',
51  ],
52  'suggests' => [],
53  ],
54  ];
55  $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
56  $this->assertEquals($expected, $fixture->fixEmConf($input));
57  }
58 
63  {
64  $input = [
65  'title' => 'a title',
66  'conflicts' => 'foo,bar',
67  ];
68  $expected = [
69  'title' => 'a title',
70  'constraints' => [
71  'depends' => [],
72  'conflicts' => [
73  'foo' => '',
74  'bar' => '',
75  ],
76  'suggests' => [],
77  ],
78  ];
79  $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
80  $this->assertEquals($expected, $fixture->fixEmConf($input));
81  }
82 }