2 namespace TYPO3\CMS\Install\Service;
19 use TYPO3\CMS\Install\Controller\Exception\RedirectException;
37 $this->configurationManager = $this->getMock(
38 ConfigurationManager::class,
51 array(
'',
'rsa',
true,
false),
52 array(
'normal',
'rsa',
true,
true),
53 array(
'rsa',
'normal',
false,
true),
65 public function configureBackendLoginSecurity($current, $setting, $isPackageActive, $hasLocalConfig)
68 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
69 SilentConfigurationUpgradeService::class,
77 $packageManager = $this->getMock(PackageManager::class, array(), array(),
'',
false);
78 $packageManager->expects($this->any())
79 ->method(
'isPackageActive')
80 ->will($this->returnValue($isPackageActive));
83 $currentLocalConfiguration = array(
84 array(
'BE/loginSecurityLevel', $current)
86 $closure =
function () {
87 throw new \RuntimeException(
'Path does not exist in array', 1341397869);
92 'getLocalConfigurationValueByPath',
93 'setLocalConfigurationValueByPath',
96 if ($hasLocalConfig) {
97 $this->configurationManager->expects($this->once())
98 ->method(
'getLocalConfigurationValueByPath')
99 ->will($this->returnValueMap($currentLocalConfiguration));
101 $this->configurationManager->expects($this->once())
102 ->method(
'getLocalConfigurationValueByPath')
103 ->will($this->returnCallback($closure));
105 $this->configurationManager->expects($this->once())
106 ->method(
'setLocalConfigurationValueByPath')
107 ->with($this->equalTo(
'BE/loginSecurityLevel'), $this->equalTo($setting));
109 $this->setExpectedException(RedirectException::class);
111 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
113 $silentConfigurationUpgradeServiceInstance->_call(
'configureBackendLoginSecurity');
119 public function removeObsoleteLocalConfigurationSettingsIfThereAreOldSettings()
122 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
123 SilentConfigurationUpgradeService::class,
130 $obsoleteLocalConfigurationSettings = array(
134 $currentLocalConfiguration = array(
135 array($obsoleteLocalConfigurationSettings,
true)
139 'removeLocalConfigurationKeysByPath',
142 $this->configurationManager->expects($this->exactly(1))
143 ->method(
'removeLocalConfigurationKeysByPath')
144 ->will($this->returnValueMap($currentLocalConfiguration));
146 $this->setExpectedException(RedirectException::class);
148 $silentConfigurationUpgradeServiceInstance->_set(
'obsoleteLocalConfigurationSettings', $obsoleteLocalConfigurationSettings);
149 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
151 $silentConfigurationUpgradeServiceInstance->_call(
'removeObsoleteLocalConfigurationSettings');
157 public function doNotRemoveObsoleteLocalConfigurationSettingsIfThereAreNoOldSettings()
160 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
161 SilentConfigurationUpgradeService::class,
168 $obsoleteLocalConfigurationSettings = array(
172 $currentLocalConfiguration = array(
173 array($obsoleteLocalConfigurationSettings,
false)
177 'removeLocalConfigurationKeysByPath',
180 $this->configurationManager->expects($this->exactly(1))
181 ->method(
'removeLocalConfigurationKeysByPath')
182 ->will($this->returnValueMap($currentLocalConfiguration));
184 $silentConfigurationUpgradeServiceInstance->_set(
'obsoleteLocalConfigurationSettings', $obsoleteLocalConfigurationSettings);
185 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
187 $silentConfigurationUpgradeServiceInstance->_call(
'removeObsoleteLocalConfigurationSettings');
193 public function configureSaltedPasswordsWithDefaultConfiguration()
196 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
197 SilentConfigurationUpgradeService::class,
203 $config =
'a:2:{s:3:"BE.";a:3:{s:11:"forceSalted";i:0;s:15:"onlyAuthService";i:0;s:12:"updatePasswd";i:1;}s:3:"FE.";a:4:{s:7:"enabled";i:0;s:11:"forceSalted";i:0;s:15:"onlyAuthService";i:0;s:12:"updatePasswd";i:1;}}';
204 $defaultConfiguration = array();
205 $defaultConfiguration[
'EXT'][
'extConf'][
'saltedpasswords'] = $config;
207 $closure =
function () {
208 throw new \RuntimeException(
'Path does not exist in array', 1341397869);
213 'getDefaultConfiguration',
214 'getLocalConfigurationValueByPath',
215 'setLocalConfigurationValueByPath',
218 $this->configurationManager->expects($this->exactly(1))
219 ->method(
'getDefaultConfiguration')
220 ->will($this->returnValue($defaultConfiguration));
221 $this->configurationManager->expects($this->exactly(1))
222 ->method(
'getLocalConfigurationValueByPath')
223 ->will($this->returnCallback($closure));
224 $this->configurationManager->expects($this->once())
225 ->method(
'setLocalConfigurationValueByPath')
226 ->with($this->equalTo(
'EXT/extConf/saltedpasswords'), $this->equalTo($config));
228 $this->setExpectedException(RedirectException::class);
230 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
232 $silentConfigurationUpgradeServiceInstance->_call(
'configureSaltedPasswords');
238 public function configureSaltedPasswordsWithExtensionConfigurationBeEnabled()
241 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
242 SilentConfigurationUpgradeService::class,
248 $config =
'a:2:{s:3:"BE.";a:1:{s:21:"saltedPWHashingMethod";}s:3:"FE.";a:2:{s:7:"enabled";i:0;s:11:"forceSalted";i:0;}}';
249 $defaultConfiguration = array();
250 $defaultConfiguration[
'EXT'][
'extConf'][
'saltedpasswords'] = $config;
252 $currentLocalConfiguration = array(
253 array(
'EXT/extConf/saltedpasswords',
'a:2:{s:3:"BE.";a:1:{s:7:"enabled";i:1;}s:3:"FE.";a:1:{s:7:"enabled";i:0;}}')
255 $newConfig =
'a:2:{s:3:"BE.";a:0:{}s:3:"FE.";a:1:{s:7:"enabled";i:0;}}';
258 'getDefaultConfiguration',
259 'getLocalConfigurationValueByPath',
260 'setLocalConfigurationValueByPath',
263 $this->configurationManager->expects($this->exactly(1))
264 ->method(
'getDefaultConfiguration')
265 ->will($this->returnValue($defaultConfiguration));
266 $this->configurationManager->expects($this->exactly(1))
267 ->method(
'getLocalConfigurationValueByPath')
268 ->will($this->returnValueMap($currentLocalConfiguration));
269 $this->configurationManager->expects($this->once())
270 ->method(
'setLocalConfigurationValueByPath')
271 ->with($this->equalTo(
'EXT/extConf/saltedpasswords'), $this->equalTo($newConfig));
273 $this->setExpectedException(RedirectException::class);
275 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
277 $silentConfigurationUpgradeServiceInstance->_call(
'configureSaltedPasswords');
283 public function configureSaltedPasswordsWithExtensionConfigurationBeNotEnabled()
286 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
287 SilentConfigurationUpgradeService::class,
293 $config =
'a:2:{s:3:"BE.";a:1:{s:15:"onlyAuthService";i:0;}s:3:"FE.";a:2:{s:7:"enabled";i:0;s:11:"forceSalted";i:0;}}';
294 $defaultConfiguration = array();
295 $defaultConfiguration[
'EXT'][
'extConf'][
'saltedpasswords'] = $config;
297 $currentLocalConfiguration = array(
298 array(
'EXT/extConf/saltedpasswords',
'a:2:{s:3:"BE.";a:2:{s:7:"enabled";i:0;s:12:"updatePasswd";i:1;}s:3:"FE.";a:1:{s:7:"enabled";i:0;}}')
300 $newConfig =
'a:2:{s:3:"BE.";a:1:{s:15:"onlyAuthService";i:0;}s:3:"FE.";a:1:{s:7:"enabled";i:0;}}';
303 'getDefaultConfiguration',
304 'getLocalConfigurationValueByPath',
305 'setLocalConfigurationValueByPath',
308 $this->configurationManager->expects($this->exactly(1))
309 ->method(
'getDefaultConfiguration')
310 ->will($this->returnValue($defaultConfiguration));
311 $this->configurationManager->expects($this->exactly(1))
312 ->method(
'getLocalConfigurationValueByPath')
313 ->will($this->returnValueMap($currentLocalConfiguration));
314 $this->configurationManager->expects($this->once())
315 ->method(
'setLocalConfigurationValueByPath')
316 ->with($this->equalTo(
'EXT/extConf/saltedpasswords'), $this->equalTo($newConfig));
318 $this->setExpectedException(RedirectException::class);
320 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
322 $silentConfigurationUpgradeServiceInstance->_call(
'configureSaltedPasswords');
328 public function noProxyAuthSchemeSetInLocalConfiguration()
331 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
332 SilentConfigurationUpgradeService::class,
339 $closure =
function () {
340 throw new \RuntimeException(
'Path does not exist in array', 1341397869);
345 'getLocalConfigurationValueByPath',
346 'removeLocalConfigurationKeysByPath',
349 $this->configurationManager->expects($this->exactly(1))
350 ->method(
'getLocalConfigurationValueByPath')
351 ->will($this->returnCallback($closure));
352 $this->configurationManager->expects($this->never())
353 ->method(
'removeLocalConfigurationKeysByPath');
355 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
357 $silentConfigurationUpgradeServiceInstance->_call(
'setProxyAuthScheme');
363 public function proxyAuthSchemeIsDigest()
366 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
367 SilentConfigurationUpgradeService::class,
374 $currentLocalConfiguration = array(
375 array(
'HTTP/proxy_auth_scheme',
'digest')
380 'getLocalConfigurationValueByPath',
381 'removeLocalConfigurationKeysByPath',
384 $this->configurationManager->expects($this->exactly(1))
385 ->method(
'getLocalConfigurationValueByPath')
386 ->will($this->returnValueMap($currentLocalConfiguration));
387 $this->configurationManager->expects($this->never())
388 ->method(
'removeLocalConfigurationKeysByPath');
390 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
392 $silentConfigurationUpgradeServiceInstance->_call(
'setProxyAuthScheme');
398 public function proxyAuthSchemeIsBasic()
401 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
402 SilentConfigurationUpgradeService::class,
409 $currentLocalConfiguration = array(
410 array(
'HTTP/proxy_auth_scheme',
'basic')
415 'getLocalConfigurationValueByPath',
416 'removeLocalConfigurationKeysByPath',
419 $this->configurationManager->expects($this->exactly(1))
420 ->method(
'getLocalConfigurationValueByPath')
421 ->will($this->returnValueMap($currentLocalConfiguration));
422 $this->configurationManager->expects($this->once())
423 ->method(
'removeLocalConfigurationKeysByPath')
424 ->with($this->equalTo(array(
'HTTP/proxy_auth_scheme')));
426 $this->setExpectedException(RedirectException::class);
428 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
430 $silentConfigurationUpgradeServiceInstance->_call(
'setProxyAuthScheme');
436 public function doNotGenerateEncryptionKeyIfExists()
439 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
440 SilentConfigurationUpgradeService::class,
447 $currentLocalConfiguration = array(
448 array(
'SYS/encryptionKey',
'EnCrYpTiOnKeY')
453 'getLocalConfigurationValueByPath',
454 'setLocalConfigurationValueByPath',
457 $this->configurationManager->expects($this->exactly(1))
458 ->method(
'getLocalConfigurationValueByPath')
459 ->will($this->returnValueMap($currentLocalConfiguration));
460 $this->configurationManager->expects($this->never())
461 ->method(
'setLocalConfigurationValueByPath');
463 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
465 $silentConfigurationUpgradeServiceInstance->_call(
'generateEncryptionKeyIfNeeded');
471 public function generateEncryptionKeyIfNotExists()
474 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
475 SilentConfigurationUpgradeService::class,
482 $closure =
function () {
483 throw new \RuntimeException(
'Path does not exist in array', 1341397869);
488 'getLocalConfigurationValueByPath',
489 'setLocalConfigurationValueByPath',
492 $this->configurationManager->expects($this->exactly(1))
493 ->method(
'getLocalConfigurationValueByPath')
494 ->will($this->returnCallback($closure));
495 $this->configurationManager->expects($this->once())
496 ->method(
'setLocalConfigurationValueByPath')
497 ->with($this->equalTo(
'SYS/encryptionKey'), $this->isType(
'string'));
499 $this->setExpectedException(RedirectException::class);
501 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
503 $silentConfigurationUpgradeServiceInstance->_call(
'generateEncryptionKeyIfNeeded');
514 array(
'http://proxy:3128/',
'proxy',
'3128'),
515 array(
'http://proxy:3128',
'proxy',
'3128'),
516 array(
'proxy:3128',
'proxy',
'3128'),
517 array(
'https://proxy:3128/',
'proxy',
'3128'),
528 public function transferDeprecatedCurlSettings($curlProxyServer, $proxyHost, $proxyPort)
531 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
532 SilentConfigurationUpgradeService::class,
539 $currentLocalConfiguration = array(
540 array(
'SYS/curlProxyServer', $curlProxyServer),
541 array(
'HTTP/proxy_host',
''),
542 array(
'SYS/curlProxyUserPass',
''),
543 array(
'HTTP/proxy_user',
''),
544 array(
'SYS/curlUse',
false)
548 'getLocalConfigurationValueByPath',
549 'setLocalConfigurationValueByPath',
550 'getConfigurationValueByPath'
553 $this->configurationManager->expects($this->exactly(5))
554 ->method(
'getLocalConfigurationValueByPath')
555 ->will($this->returnValueMap($currentLocalConfiguration));
556 $this->configurationManager->expects($this->exactly(2))
557 ->method(
'setLocalConfigurationValueByPath')
559 array(
'HTTP/proxy_host', $proxyHost),
560 array(
'HTTP/proxy_port', $proxyPort)
563 $this->setExpectedException(RedirectException::class);
565 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
567 $silentConfigurationUpgradeServiceInstance->_call(
'transferDeprecatedCurlSettings');
573 public function curlProxyServerDoesNotOverwriteHttpSettings()
576 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
577 SilentConfigurationUpgradeService::class,
584 $currentLocalConfiguration = array(
585 array(
'SYS/curlProxyServer',
'http://proxyOld:3128/'),
586 array(
'SYS/curlProxyUserPass',
'userOld:passOld'),
587 array(
'HTTP/proxy_host',
'proxyNew'),
588 array(
'HTTP/proxy_port',
'3128'),
589 array(
'HTTP/proxy_user',
'userNew'),
590 array(
'HTTP/proxy_pass',
'passNew'),
591 array(
'SYS/curlUse',
false)
595 'getLocalConfigurationValueByPath',
596 'setLocalConfigurationValueByPath',
597 'getConfigurationValueByPath'
600 $this->configurationManager->expects($this->exactly(5))
601 ->method(
'getLocalConfigurationValueByPath')
602 ->will($this->returnValueMap($currentLocalConfiguration));
603 $this->configurationManager->expects($this->never())
604 ->method(
'setLocalConfigurationValueByPath');
606 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
608 $silentConfigurationUpgradeServiceInstance->_call(
'transferDeprecatedCurlSettings');
614 public function curlAdapterUsedIfCurlUse()
617 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
618 SilentConfigurationUpgradeService::class,
625 $currentLocalConfiguration = array(
626 array(
'SYS/curlProxyServer',
''),
627 array(
'SYS/curlProxyUserPass',
''),
628 array(
'HTTP/proxy_host',
'proxyNew'),
629 array(
'HTTP/proxy_user',
'userNew'),
630 array(
'SYS/curlUse',
true)
634 'getLocalConfigurationValueByPath',
635 'getConfigurationValueByPath',
636 'setLocalConfigurationValueByPath',
639 $this->configurationManager->expects($this->exactly(5))
640 ->method(
'getLocalConfigurationValueByPath')
641 ->will($this->returnValueMap($currentLocalConfiguration));
642 $this->configurationManager->expects($this->once())
643 ->method(
'setLocalConfigurationValueByPath')
645 array(
'HTTP/adapter',
'curl')
648 $this->setExpectedException(RedirectException::class);
650 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
652 $silentConfigurationUpgradeServiceInstance->_call(
'transferDeprecatedCurlSettings');
658 public function disableImageMagickIfImageProcessingIsDisabled()
661 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
662 SilentConfigurationUpgradeService::class,
669 $currentLocalConfiguration = array(
670 array(
'GFX/image_processing', 0),
672 array(
'GFX/gdlib', 0)
676 'getLocalConfigurationValueByPath',
677 'getDefaultConfigurationValueByPath',
678 'setLocalConfigurationValuesByPathValuePairs',
681 $this->configurationManager->expects($this->exactly(3))
682 ->method(
'getLocalConfigurationValueByPath')
683 ->will($this->returnValueMap($currentLocalConfiguration));
684 $this->configurationManager->expects($this->never())
685 ->method(
'getDefaultConfigurationValueByPath');
686 $this->configurationManager->expects($this->once())
687 ->method(
'setLocalConfigurationValuesByPathValuePairs')
689 array(array(
'GFX/im' => 0))
692 $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
694 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
696 $silentConfigurationUpgradeServiceInstance->_call(
'disableImageMagickAndGdlibIfImageProcessingIsDisabled');
702 public function disableGdlibIfImageProcessingIsDisabled()
705 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
706 SilentConfigurationUpgradeService::class,
713 $currentLocalConfiguration = array(
714 array(
'GFX/image_processing', 0),
716 array(
'GFX/gdlib', 1)
720 'getLocalConfigurationValueByPath',
721 'getDefaultConfigurationValueByPath',
722 'setLocalConfigurationValuesByPathValuePairs',
725 $this->configurationManager->expects($this->exactly(3))
726 ->method(
'getLocalConfigurationValueByPath')
727 ->will($this->returnValueMap($currentLocalConfiguration));
728 $this->configurationManager->expects($this->never())
729 ->method(
'getDefaultConfigurationValueByPath');
730 $this->configurationManager->expects($this->once())
731 ->method(
'setLocalConfigurationValuesByPathValuePairs')
733 array(array(
'GFX/gdlib' => 0))
736 $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
738 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
740 $silentConfigurationUpgradeServiceInstance->_call(
'disableImageMagickAndGdlibIfImageProcessingIsDisabled');
746 public function doNotDisableImageMagickAndGdlibIfImageProcessingIsEnabled()
749 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
750 SilentConfigurationUpgradeService::class,
757 $currentLocalConfiguration = array(
758 array(
'GFX/image_processing', 1),
760 array(
'GFX/gdlib', 1)
764 'getLocalConfigurationValueByPath',
765 'getDefaultConfigurationValueByPath',
766 'setLocalConfigurationValuesByPathValuePairs',
769 $this->configurationManager->expects($this->exactly(3))
770 ->method(
'getLocalConfigurationValueByPath')
771 ->will($this->returnValueMap($currentLocalConfiguration));
772 $this->configurationManager->expects($this->never())
773 ->method(
'getDefaultConfigurationValueByPath');
774 $this->configurationManager->expects($this->never())
775 ->method(
'setLocalConfigurationValuesByPathValuePairs');
777 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
779 $silentConfigurationUpgradeServiceInstance->_call(
'disableImageMagickAndGdlibIfImageProcessingIsDisabled');
785 public function disableImageMagickIfDefaultImageProcessingIsDisabled()
788 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
789 SilentConfigurationUpgradeService::class,
796 $currentDefaultConfiguration = array(
797 array(
'GFX/image_processing', 0),
799 $closure =
function ($param) {
808 throw new \RuntimeException(
'Path does not exist in array', 1341397869);
814 'getLocalConfigurationValueByPath',
815 'getDefaultConfigurationValueByPath',
816 'setLocalConfigurationValuesByPathValuePairs',
819 $this->configurationManager->expects($this->exactly(3))
820 ->method(
'getLocalConfigurationValueByPath')
821 ->will($this->returnCallback($closure));
822 $this->configurationManager->expects($this->exactly(1))
823 ->method(
'getDefaultConfigurationValueByPath')
824 ->will($this->returnValueMap($currentDefaultConfiguration));
825 $this->configurationManager->expects($this->once())
826 ->method(
'setLocalConfigurationValuesByPathValuePairs')
828 array(array(
'GFX/im' => 0))
831 $this->setExpectedException(RedirectException::class);
833 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
835 $silentConfigurationUpgradeServiceInstance->_call(
'disableImageMagickAndGdlibIfImageProcessingIsDisabled');
841 public function disableImageMagickDetailSettingsIfImageMagickIsDisabled()
844 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
845 SilentConfigurationUpgradeService::class,
852 $currentLocalConfiguration = array(
854 array(
'GFX/im_path',
''),
855 array(
'GFX/im_path_lzw',
''),
856 array(
'GFX/imagefile_ext',
'gif,jpg,png'),
857 array(
'GFX/thumbnails', 0)
861 'getLocalConfigurationValueByPath',
862 'getDefaultConfigurationValueByPath',
863 'setLocalConfigurationValuesByPathValuePairs',
866 $this->configurationManager->expects($this->exactly(5))
867 ->method(
'getLocalConfigurationValueByPath')
868 ->will($this->returnValueMap($currentLocalConfiguration));
869 $this->configurationManager->expects($this->never())
870 ->method(
'getDefaultConfigurationValueByPath');
871 $this->configurationManager->expects($this->once())
872 ->method(
'setLocalConfigurationValuesByPathValuePairs')
874 array(array(
'GFX/imagefile_ext' =>
'gif,jpg,jpeg,png'))
877 $this->setExpectedException(RedirectException::class);
879 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
881 $silentConfigurationUpgradeServiceInstance->_call(
'disableImageMagickDetailSettingsIfImageMagickIsDisabled');
887 public function doNotDisableImageMagickDetailSettingsIfImageMagickIsEnabled()
890 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
891 SilentConfigurationUpgradeService::class,
898 $currentLocalConfiguration = array(
900 array(
'GFX/im_path',
''),
901 array(
'GFX/im_path_lzw',
''),
902 array(
'GFX/imagefile_ext',
'gif,jpg,jpeg,png'),
903 array(
'GFX/thumbnails', 0)
907 'getLocalConfigurationValueByPath',
908 'getDefaultConfigurationValueByPath',
909 'setLocalConfigurationValuesByPathValuePairs',
912 $this->configurationManager->expects($this->exactly(5))
913 ->method(
'getLocalConfigurationValueByPath')
914 ->will($this->returnValueMap($currentLocalConfiguration));
915 $this->configurationManager->expects($this->never())
916 ->method(
'getDefaultConfigurationValueByPath');
917 $this->configurationManager->expects($this->never())
918 ->method(
'setLocalConfigurationValuesByPathValuePairs');
920 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
922 $silentConfigurationUpgradeServiceInstance->_call(
'disableImageMagickDetailSettingsIfImageMagickIsDisabled');
928 public function setImageMagickDetailSettings()
931 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
932 SilentConfigurationUpgradeService::class,
939 $currentLocalConfiguration = array(
940 array(
'GFX/im_version_5',
'gm'),
941 array(
'GFX/im_mask_temp_ext_gif', 0),
942 array(
'GFX/im_v5effects', 0)
946 'getLocalConfigurationValueByPath',
947 'getDefaultConfigurationValueByPath',
948 'setLocalConfigurationValuesByPathValuePairs',
951 $this->configurationManager->expects($this->exactly(3))
952 ->method(
'getLocalConfigurationValueByPath')
953 ->will($this->returnValueMap($currentLocalConfiguration));
954 $this->configurationManager->expects($this->never())
955 ->method(
'getDefaultConfigurationValueByPath');
956 $this->configurationManager->expects($this->once())
957 ->method(
'setLocalConfigurationValuesByPathValuePairs')
959 array(array(
'GFX/im_mask_temp_ext_gif' => 1,
960 'GFX/im_v5effects' => -1))
963 $this->setExpectedException(RedirectException::class);
965 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
967 $silentConfigurationUpgradeServiceInstance->_call(
'setImageMagickDetailSettings');
973 public function doNotSetImageMagickDetailSettings()
976 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
977 SilentConfigurationUpgradeService::class,
984 $currentLocalConfiguration = array(
985 array(
'GFX/im_version_5',
''),
986 array(
'GFX/im_mask_temp_ext_gif', 0),
987 array(
'GFX/im_v5effects', 0)
991 'getLocalConfigurationValueByPath',
992 'getDefaultConfigurationValueByPath',
993 'setLocalConfigurationValuesByPathValuePairs',
996 $this->configurationManager->expects($this->exactly(3))
997 ->method(
'getLocalConfigurationValueByPath')
998 ->will($this->returnValueMap($currentLocalConfiguration));
999 $this->configurationManager->expects($this->never())
1000 ->method(
'getDefaultConfigurationValueByPath');
1001 $this->configurationManager->expects($this->never())
1002 ->method(
'setLocalConfigurationValuesByPathValuePairs');
1004 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
1006 $silentConfigurationUpgradeServiceInstance->_call(
'setImageMagickDetailSettings');