TYPO3  7.6
EmConfUtilityTest.php
Go to the documentation of this file.
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 
20 class EmConfUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
21 {
26  {
27  $extensionData = array(
28  'extKey' => 'key',
29  'EM_CONF' => array(),
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 = array(
42  'title' => 'a title',
43  'conflicts' => 'foo',
44  );
45  $expected = array(
46  'title' => 'a title',
47  'constraints' => array(
48  'depends' => array(),
49  'conflicts' => array(
50  'foo' => '',
51  ),
52  'suggests' => array(),
53  ),
54  );
55  $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
56  $this->assertEquals($expected, $fixture->fixEmConf($input));
57  }
58 
63  {
64  $input = array(
65  'title' => 'a title',
66  'conflicts' => 'foo,bar',
67  );
68  $expected = array(
69  'title' => 'a title',
70  'constraints' => array(
71  'depends' => array(),
72  'conflicts' => array(
73  'foo' => '',
74  'bar' => '',
75  ),
76  'suggests' => array(),
77  ),
78  );
79  $fixture = new \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility();
80  $this->assertEquals($expected, $fixture->fixEmConf($input));
81  }
82 }