3e36bd662b7b9cc2ef411a8945b5dd6bed819f30
[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 * Copyright notice
6 *
7 * (c) 2012
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26
27 /**
28 * @package Extension Manager
29 * @subpackage Tests
30 */
31 class EmConfUtilityTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
32
33 /**
34 * Data Provider for construct em conf tests
35 *
36 * @return array
37 */
38 public function constructEmConfDataProvider() {
39 return array(
40 array(
41 array(
42 'extKey' => 'enetcache',
43 'EM_CONF' => array(
44 'title' => 'Plugin cache engine',
45 'description' => 'Provides an interface to cache plugin content elements based on 4.3 caching framework',
46 'category' => 'Frontend',
47 'shy' => 0,
48 'version' => '1.0.6',
49 'dependencies' => '',
50 'conflicts' => '',
51 'priority' => '',
52 'loadOrder' => '',
53 'TYPO3_version' => '4.3.0-0.0.0',
54 'PHP_version' => '',
55 'module' => '',
56 'state' => 'stable',
57 'uploadfolder' => 0,
58 'createDirs' => '',
59 'modify_tables' => '',
60 'clearcacheonload' => 0,
61 'lockType' => '',
62 'author' => 'Firstname Lastname',
63 'author_email' => 'test@example.com',
64 'author_company' => 'test',
65 'CGLcompliance' => NULL,
66 'CGLcompliance_note' => NULL
67 )
68 )
69 )
70 );
71 }
72
73 /**
74 * Tests whether the comment block is added
75 *
76 * @param array $extensionData
77 * @test
78 * @dataProvider constructEmConfDataProvider
79 * @return void
80 */
81 public function constructEmConfAddsCommentBlock(array $extensionData) {
82 $fileHandlerMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Utility\\EmConfUtility', array('includeEmConf'));
83 $emConf = $fileHandlerMock->_call('constructEmConf', $extensionData);
84 $this->assertContains('Extension Manager/Repository config file for ext', $emConf);
85 }
86
87 }
88
89
90 ?>