26 public function getCurrentConfigurationReturnsExtensionConfigurationAsValuedConfiguration() {
28 $configurationUtility = $this->getMock(
29 'TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility',
30 array(
'getDefaultConfigurationFromExtConfTemplateAsValuedArray')
33 ->expects($this->once())
34 ->method(
'getDefaultConfigurationFromExtConfTemplateAsValuedArray')
35 ->will($this->returnValue(array()));
36 $extensionKey = $this->
getUniqueId(
'some-extension');
38 $currentConfiguration = array(
49 'key2.subkey1' => array(
54 $GLOBALS[
'TYPO3_CONF_VARS'][
'EXT'][
'extConf'][$extensionKey] = serialize($currentConfiguration);
55 $actual = $configurationUtility->getCurrentConfiguration($extensionKey);
56 $this->assertEquals($expected, $actual);
62 public function getDefaultConfigurationFromExtConfTemplateAsValuedArrayReturnsExpectedExampleArray() {
65 'TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility',
66 array(
'getDefaultConfigurationRawString',
'getExtensionPathInformation')
69 ->expects($this->once())
70 ->method(
'getDefaultConfigurationRawString')
71 ->will($this->returnValue(
'foo'));
74 ->expects($this->once())
75 ->method(
'getExtensionPathInformation')
76 ->will($this->returnValue(NULL));
78 $tsStyleConfig = $this->getMock(
'TYPO3\\CMS\\Core\\TypoScript\\ConfigurationForm');
80 $objectManagerMock = $this->getMock(
'TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
81 $configurationUtility->_set(
'objectManager', $objectManagerMock);
83 ->expects($this->once())
85 ->with(
'TYPO3\\CMS\\Core\\TypoScript\\ConfigurationForm')
86 ->will($this->returnValue($tsStyleConfig));
89 'checkConfigurationFE' => array(
91 'subcat_name' =>
'enable',
92 'subcat' =>
'a/enable/z',
93 'type' =>
'user[TYPO3\\CMS\\Saltedpasswords\\Utility\\ExtensionManagerConfigurationUtility->checkConfigurationFrontend]',
94 'label' =>
'Frontend configuration check',
95 'name' =>
'checkConfigurationFE',
97 'default_value' =>
'0' 99 'BE.forceSalted' => array(
100 'cat' =>
'advancedbackend',
103 'label' =>
'Force salted passwords: Enforce usage of SaltedPasswords. Old MD5 hashed passwords will stop working.',
104 'name' =>
'BE.forceSalted',
106 'default_value' =>
'0' 110 ->expects($this->once())
111 ->method(
'ext_initTSstyleConfig')
112 ->will($this->returnValue($constants));
114 $setupTsConstantEditor = array(
115 'advancedbackend.' => array(
116 'description' =>
'<span style="background:red; padding:1px 2px; color:#fff; font-weight:bold;">1</span> Install tool has hardcoded md5 hashing, enabling this setting will prevent use of a install-tool-created BE user.<br />Currently same is for changin password with user setup module unless you use pending patch!',
117 1 =>
'BE.forceSalted' 120 $tsStyleConfig->setup[
'constants'][
'TSConstantEditor.'] = $setupTsConstantEditor;
123 'checkConfigurationFE' => array(
125 'subcat_name' =>
'enable',
126 'subcat' =>
'a/enable/z',
127 'type' =>
'user[TYPO3\\CMS\\Saltedpasswords\\Utility\\ExtensionManagerConfigurationUtility->checkConfigurationFrontend]',
128 'label' =>
'Frontend configuration check',
129 'name' =>
'checkConfigurationFE',
131 'default_value' =>
'0',
132 'subcat_label' =>
'Enable features',
134 'BE.forceSalted' => array(
135 'cat' =>
'advancedbackend',
138 'label' =>
'Force salted passwords: Enforce usage of SaltedPasswords. Old MD5 hashed passwords will stop working.',
139 'name' =>
'BE.forceSalted',
141 'default_value' =>
'0',
145 'advancedbackend' => array(
146 'highlightText' =>
'<span style="background:red; padding:1px 2px; color:#fff; font-weight:bold;">1</span> Install tool has hardcoded md5 hashing, enabling this setting will prevent use of a install-tool-created BE user.<br />Currently same is for changin password with user setup module unless you use pending patch!' 151 $result = $configurationUtility->getDefaultConfigurationFromExtConfTemplateAsValuedArray($this->
getUniqueId(
'some_extension'));
152 $this->assertEquals($expected,
$result);
162 'plain array' => array(
176 'nested value with 2 levels' => array(
178 'first.firstSub' => array(
181 'second.secondSub' => array(
187 'firstSub' =>
'value1' 190 'secondSub' =>
'value2' 194 'nested value with 3 levels' => array(
196 'first.firstSub.firstSubSub' => array(
199 'second.secondSub.secondSubSub' => array(
205 'firstSub.' => array(
206 'firstSubSub' =>
'value1' 210 'secondSub.' => array(
211 'secondSubSub' =>
'value2' 216 'mixed nested value with 2 levels' => array(
219 'value' =>
'firstValue' 221 'first.firstSub' => array(
224 'second.secondSub' => array(
229 'first' =>
'firstValue',
231 'firstSub' =>
'value1' 234 'secondSub' =>
'value2' 249 public function convertValuedToNestedConfiguration(array $configuration, array $expected) {
251 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility', array(
'dummy'), array(),
'', FALSE);
252 $this->assertEquals($expected, $subject->convertValuedToNestedConfiguration($configuration));
262 'plain array' => array(
268 'first' => array(
'value' =>
'value1'),
269 'second' => array(
'value' =>
'value2'),
272 'two levels' => array(
274 'first.' => array(
'firstSub' =>
'value1'),
275 'second.' => array(
'firstSub' =>
'value2'),
278 'first.firstSub' => array(
'value' =>
'value1'),
279 'second.firstSub' => array(
'value' =>
'value2'),
282 'three levels' => array(
284 'first.' => array(
'firstSub.' => array(
'firstSubSub' =>
'value1')),
285 'second.' => array(
'firstSub.' => array(
'firstSubSub' =>
'value2'))
288 'first.firstSub.firstSubSub' => array(
'value' =>
'value1'),
289 'second.firstSub.firstSubSub' => array(
'value' =>
'value2'),
294 'first.' => array(
'firstSub' =>
'value1'),
295 'second.' => array(
'firstSub.' => array(
'firstSubSub' =>
'value2')),
299 'first.firstSub' => array(
'value' =>
'value1'),
300 'second.firstSub.firstSubSub' => array(
'value' =>
'value2'),
301 'third' => array(
'value' =>
'value3')
315 public function convertNestedToValuedConfiguration(array $configuration, array $expected) {
317 $subject = $this->
getAccessibleMock(
'TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility', array(
'dummy'), array(),
'', FALSE);
318 $this->assertEquals($expected, $subject->convertNestedToValuedConfiguration($configuration));
convertValuedToNestedConfigurationDataProvider()
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
convertNestedToValuedConfigurationDataProvider()