41 'TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ConfigurationItemRepository',
45 $this->injectedObjectManagerMock = $this->getMock(
'TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface', array(), array(),
'', FALSE);
46 $this->configurationItemRepository->_set(
48 $this->injectedObjectManagerMock
56 $flatConfigurationItemArray = array(
59 'subcat_name' =>
'enable',
60 'subcat' =>
'a/enable/10z',
62 'label' =>
'Item 1: This is the first configuration item',
65 'default_value' =>
'one',
66 'subcat_label' =>
'Enable features',
68 'integerValue' => array(
70 'subcat_name' =>
'enable',
71 'subcat' =>
'a/enable/20z',
73 'label' =>
'Integer Value: Please insert a positive integer value',
74 'name' =>
'integerValue',
76 'default_value' =>
'1',
77 'subcat_label' =>
'Enable features',
79 'enableJquery' => array(
81 'subcat_name' =>
'file',
82 'subcat' =>
'c/file/10z',
84 'label' =>
'enableJquery: Insert jQuery plugin',
85 'name' =>
'enableJquery',
87 'default_value' =>
'1',
88 'subcat_label' =>
'Files',
93 'TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ConfigurationItemRepository',
94 array(
'mergeWithExistingConfiguration',
'translate')
98 $this->injectedObjectManagerMock
100 $configurationUtilityMock = $this->getMock(
'TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility', array(), array(),
'', FALSE);
101 $configurationUtilityMock
102 ->expects($this->once())
103 ->method(
'getDefaultConfigurationFromExtConfTemplateAsValuedArray')
104 ->will($this->returnValue($flatConfigurationItemArray));
105 $this->injectedObjectManagerMock
106 ->expects($this->any())
108 ->will($this->returnValue($configurationUtilityMock));
110 ->expects($this->any())
111 ->method(
'mergeWithExistingConfiguration')
112 ->will($this->returnValue($flatConfigurationItemArray));
114 $expectedArray = array(
119 'subcat_name' =>
'enable',
120 'subcat' =>
'a/enable/10z',
122 'label' =>
'Item 1: This is the first configuration item',
125 'default_value' =>
'one',
126 'subcat_label' =>
'Enable features',
129 1 =>
'This is the first configuration item' 132 'integerValue' => array(
134 'subcat_name' =>
'enable',
135 'subcat' =>
'a/enable/20z',
137 'label' =>
'Integer Value: Please insert a positive integer value',
138 'name' =>
'integerValue',
140 'default_value' =>
'1',
141 'subcat_label' =>
'Enable features',
143 0 =>
'Integer Value',
144 1 =>
'Please insert a positive integer value' 151 'enableJquery' => array(
153 'subcat_name' =>
'file',
154 'subcat' =>
'c/file/10z',
156 'label' =>
'enableJquery: Insert jQuery plugin',
157 'name' =>
'enableJquery',
159 'default_value' =>
'1',
160 'subcat_label' =>
'Files',
163 1 =>
'Insert jQuery plugin' 181 $configuration = array(
182 '__meta__' =>
'metaInformation',
183 'test123' =>
'test123' 185 $this->configurationItemRepository->_callRef(
'addMetaInformation', $configuration);
186 $this->assertEquals(array(
'test123' =>
'test123'), $configuration);
194 $configuration = array(
195 '__meta__' =>
'metaInformation',
196 'test123' =>
'test123' 198 $meta = $this->configurationItemRepository->_callRef(
'addMetaInformation', $configuration);
199 $this->assertEquals(
'metaInformation', $meta);
210 'subcat_name' =>
'enable',
211 'subcat' =>
'a/enable/z',
212 'type' =>
'user[EXT:saltedpasswords/classes/class.tx_saltedpasswords_emconfhelper.php:TYPO3\\CMS\\Saltedpasswords\\Utility\\ExtensionManagerConfigurationUtility->checkConfigurationFrontend]',
213 'label' =>
'Frontend configuration check',
214 'name' =>
'checkConfigurationFE',
216 'default_value' => 0,
217 'comparisonGeneric' =>
'EXT:saltedpasswords/classes/class.tx_saltedpasswords_emconfhelper.php:TYPO3\\CMS\\Saltedpasswords\\Utility\\ExtensionManagerConfigurationUtility->checkConfigurationFrontend' 223 'subcat_name' =>
'enable',
224 'subcat' =>
'a/enable/z',
225 'type' =>
'user[EXT:saltedpasswords/classes/class.tx_saltedpasswords_emconfhelper.php:TYPO3\\CMS\\Saltedpasswords\\Utility\\ExtensionManagerConfigurationUtility->checkConfigurationBackend]',
226 'label' =>
'Backend configuration check',
227 'name' =>
'checkConfigurationBE',
229 'default_value' => 0,
230 'comparisonGeneric' =>
'EXT:saltedpasswords/classes/class.tx_saltedpasswords_emconfhelper.php:TYPO3\\CMS\\Saltedpasswords\\Utility\\ExtensionManagerConfigurationUtility->checkConfigurationBackend' 236 'subcat_name' =>
'enable',
237 'subcat' =>
'a/enable/z',
238 'type' =>
'user[EXT:saltedpasswords/classes/class.tx_saltedpasswords_emconfhelper.php:TYPO3\\CMS\\Saltedpasswords\\Utility\\ExtensionManagerConfigurationUtility->buildHashMethodSelectorFE]',
239 'label' =>
'Hashing method for the frontend: Defines salted hashing method to use. Choose "Portable PHP password hashing" to stay compatible with other CMS (e.g. Drupal, Wordpress). Choose "MD5 salted hashing" to reuse TYPO3 passwords for OS level authentication (other servers could use TYPO3 passwords). Choose "Blowfish salted hashing" for advanced security to reuse passwords on OS level (Blowfish might not be supported on your system TODO).',
240 'name' =>
'FE.saltedPWHashingMethod',
241 'value' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt',
242 'default_value' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt',
243 'comparisonGeneric' =>
'EXT:saltedpasswords/classes/class.tx_saltedpasswords_emconfhelper.php:TYPO3\\CMS\\Saltedpasswords\\Utility\\ExtensionManagerConfigurationUtility->buildHashMethodSelectorFE' 256 $configurationOptionModified = $this->configurationItemRepository->_callRef(
'extractInformationForConfigFieldsOfTypeUser', $configurationOption);
257 $this->assertEquals(
'user', $configurationOptionModified[
'type']);
258 $this->assertEquals($configurationOption[
'comparisonGeneric'], $configurationOptionModified[
'generic']);
268 'subcat_name' =>
'enable',
269 'subcat' =>
'a/enable/100z',
270 'type' =>
'options[Minimal (Most features disabled. Administrator needs to enable them using TypoScript. For advanced administrators only.),Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.),Demo (Show-off configuration. Includes pre-configured styles. Not for production environments.)]',
271 'label' =>
'Default configuration settings',
272 'name' =>
'defaultConfiguration',
273 'value' =>
'Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.)',
274 'default_value' =>
'Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.)',
275 'genericComparisonValue' => array(
276 'Minimal (Most features disabled. Administrator needs to enable them using TypoScript. For advanced administrators only.)' =>
'Minimal (Most features disabled. Administrator needs to enable them using TypoScript. For advanced administrators only.)',
277 'Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.)' =>
'Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.)',
278 'Demo (Show-off configuration. Includes pre-configured styles. Not for production environments.)' =>
'Demo (Show-off configuration. Includes pre-configured styles. Not for production environments.)' 280 'typeComparisonValue' =>
'options' 282 $optionModified = $this->configurationItemRepository->_callRef(
'extractInformationForConfigFieldsOfTypeOptions', $option);
283 $this->assertArrayHasKey(
'generic', $optionModified);
284 $this->assertArrayHasKey(
'type', $optionModified);
285 $this->assertArrayHasKey(
'label', $optionModified);
286 $this->assertEquals($option[
'genericComparisonValue'], $optionModified[
'generic']);
287 $this->assertEquals($option[
'typeComparisonValue'], $optionModified[
'type']);
297 'subcat_name' =>
'enable',
298 'subcat' =>
'a/enable/100z',
299 'type' =>
'options[Minimal (Most features disabled. Administrator needs to enable them using TypoScript. For advanced administrators only.)=MINIMAL,Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.) = TYPICAL,Demo (Show-off configuration. Includes pre-configured styles. Not for production environments.)=DEMO]',
300 'label' =>
'Default configuration settings',
301 'name' =>
'defaultConfiguration',
302 'value' =>
'Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.)',
303 'default_value' =>
'Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.)',
304 'genericComparisonValue' => array(
305 'Minimal (Most features disabled. Administrator needs to enable them using TypoScript. For advanced administrators only.)' =>
'MINIMAL',
306 'Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.)' =>
'TYPICAL',
307 'Demo (Show-off configuration. Includes pre-configured styles. Not for production environments.)' =>
'DEMO' 309 'typeComparisonValue' =>
'options' 311 $optionModified = $this->configurationItemRepository->_callRef(
'extractInformationForConfigFieldsOfTypeOptions', $option);
312 $this->assertArrayHasKey(
'generic', $optionModified);
313 $this->assertArrayHasKey(
'type', $optionModified);
314 $this->assertArrayHasKey(
'label', $optionModified);
315 $this->assertEquals($option[
'genericComparisonValue'], $optionModified[
'generic']);
316 $this->assertEquals($option[
'typeComparisonValue'], $optionModified[
'type']);
324 $exception = $this->getMock(
'RuntimeException');
325 $configurationManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
326 $configurationManagerMock
327 ->expects($this->once())
328 ->method(
'getConfigurationValueByPath')
329 ->will($this->throwException($exception));
330 $this->injectedObjectManagerMock
331 ->expects($this->any())
333 ->will($this->returnValue($configurationManagerMock));
335 $this->configurationItemRepository->_call(
336 'mergeWithExistingConfiguration',
347 $exception = $this->getMock(
'RuntimeException');
348 $configurationManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
349 $configurationManagerMock
350 ->expects($this->once())
351 ->method(
'getConfigurationValueByPath')
352 ->will($this->throwException($exception));
353 $this->injectedObjectManagerMock
354 ->expects($this->any())
356 ->will($this->returnValue($configurationManagerMock));
357 $defaultConfiguration = array(
360 $configuration = $this->configurationItemRepository->_call(
361 'mergeWithExistingConfiguration',
362 $defaultConfiguration,
365 $this->assertEquals($defaultConfiguration, $configuration);
373 $localConfiguration = serialize(array(
376 'saltedPWHashingMethod' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\SaltInterface_sha1' 383 $configurationManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
384 $configurationManagerMock
385 ->expects($this->once())
386 ->method(
'getConfigurationValueByPath')
387 ->with(
'EXT/extConf/testextensionkey')
388 ->will($this->returnValue($localConfiguration));
390 $this->injectedObjectManagerMock
391 ->expects($this->any())
393 ->will($this->returnValue($configurationManagerMock));
395 $defaultConfiguration = array(
396 'FE.enabled' => array(
399 'FE.saltedPWHashingMethod' => array(
400 'value' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt' 402 'BE.enabled' => array(
405 'BE.saltedPWHashingMethod' => array(
406 'value' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt' 410 $expectedResult = array(
411 'FE.enabled' => array(
414 'FE.saltedPWHashingMethod' => array(
415 'value' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\SaltInterface_sha1' 417 'BE.enabled' => array(
420 'BE.saltedPWHashingMethod' => array(
421 'value' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt' 423 'CLI.enabled' => array(
428 $actualResult = $this->configurationItemRepository->_call(
429 'mergeWithExistingConfiguration',
430 $defaultConfiguration,
434 $this->assertEquals($expectedResult, $actualResult);
addMetaInformationReturnsMetaInformation()
extractInformationForConfigFieldsOfTypeUserAddsGenericAndTypeInformation($configurationOption)
mergeDefaultConfigurationWithNoCurrentValuesReturnsTheDefaultConfiguration()
extractInformationForConfigFieldsOfTypeOptionsWithLabelsAndValuesAddsGenericTypeAndLabelInformation()
getConfigurationArrayFromExtensionKeyReturnsSortedHierarchicArray()
mergeWithExistingConfigurationOverwritesDefaultKeysWithCurrent()
extractInformationForConfigFieldsOfTypeUserAddsGenericAndTypeInformationDataProvider()
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
$configurationItemRepository
mergeDefaultConfigurationCatchesExceptionOfConfigurationManagerIfNoLocalConfigurationExists()
addMetaInformationUnsetsOriginalConfigurationMetaKey()
extractInformationForConfigFieldsOfTypeOptionsAddsGenericTypeAndLabelInformation()
$injectedObjectManagerMock