Completed
Push — Issue/20 ( fbefb3...bfacaa )
by Tomas Norre
31:39
created

EnvironmentTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 3 1
A pageOverlayFieldExists() 0 5 1
A rootlineFieldExists() 0 5 1
1
<?php
2
3
namespace Aoe\Languagevisibility\Tests\Unit;
4
5
/***************************************************************
6
 * Copyright notice
7
 *
8
 * (c) 2009 Tolleiv Nietsch <[email protected]>
9
 * All rights reserved
10
 *
11
 * This script is part of the TYPO3 project. The TYPO3 project is
12
 * free software; you can redistribute it and/or modify
13
 * it under the terms of the GNU General Public License as published by
14
 * the Free Software Foundation; either version 2 of the License, or
15
 * (at your option) any later version.
16
 *
17
 * The GNU General Public License can be found at
18
 * http://www.gnu.org/copyleft/gpl.html.
19
 *
20
 * This script is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 * GNU General Public License for more details.
24
 *
25
 * This copyright notice MUST APPEAR in all copies of the script!
26
 ***************************************************************/
27
28
class EnvironmentTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
29
30
	public function setUp() {
31
		require \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('languagevisibility') . 'ext_localconf.php';
32
	}
33
34
	/**
35
	 * Just to have some confidence about the system settings ;)
36
	 *
37
	 * @test
38
	 * @return void
39
	 */
40
	public function pageOverlayFieldExists() {
41
		$list = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(",", $GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields']);
42
		$this->assertEquals(TRUE, in_array('tx_languagevisibility_inheritanceflag_overlayed', $list), 'tx_languagevisibility_inheritanceflag_overlayed missing in $GLOBALS[\'TYPO3_CONF_VARS\'][\'FE\'][\'pageOverlayFields\']');
43
44
	}
45
46
	/**
47
	 * Just to have some confidence about the system settings ;)
48
	 *
49
	 * @test
50
	 * @return void
51
	 */
52
	public function rootlineFieldExists() {
53
		$list = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(",", $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']);
54
		$this->assertEquals(TRUE, in_array('tx_languagevisibility_inheritanceflag_original', $list), 'tx_languagevisibility_inheritanceflag_original missing in ,$GLOBALS[\'TYPO3_CONF_VARS\'][\'FE\'][\'addRootLineFields\']');
55
		$this->assertEquals(TRUE, in_array('tx_languagevisibility_inheritanceflag_overlayed', $list), 'tx_languagevisibility_inheritanceflag_overlayed missing in ,$GLOBALS[\'TYPO3_CONF_VARS\'][\'FE\'][\'addRootLineFields\']');
56
	}
57
}
58