2 declare(strict_types = 1);
18 use Prophecy\Argument;
19 use Prophecy\Prophecy\ObjectProphecy;
20 use TYPO3\CMS\Core\Configuration\ConfigurationManager;
23 use TYPO3\CMS\Core\Package\PackageManager;
30 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
50 protected function setUp()
70 $this->configurationManager = $this->getMockBuilder(ConfigurationManager::class)
71 ->setMethods($methods)
83 [
'',
'rsa',
true,
false],
84 [
'normal',
'rsa',
true,
true],
85 [
'rsa',
'normal',
false,
true],
100 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
101 SilentConfigurationUpgradeService::class,
109 $packageManager = $this->createMock(PackageManager::class);
110 $packageManager->expects($this->any())
111 ->method(
'isPackageActive')
112 ->will($this->returnValue($isPackageActive));
115 $currentLocalConfiguration = [
116 [
'BE/loginSecurityLevel', $current]
118 $closure =
function () {
124 'getLocalConfigurationValueByPath',
125 'setLocalConfigurationValueByPath',
128 if ($hasLocalConfig) {
129 $this->configurationManager->expects($this->once())
130 ->method(
'getLocalConfigurationValueByPath')
131 ->will($this->returnValueMap($currentLocalConfiguration));
133 $this->configurationManager->expects($this->once())
134 ->method(
'getLocalConfigurationValueByPath')
135 ->will($this->returnCallback($closure));
137 $this->configurationManager->expects($this->once())
138 ->method(
'setLocalConfigurationValueByPath')
139 ->with($this->equalTo(
'BE/loginSecurityLevel'), $this->equalTo($setting));
141 $this->expectException(ConfigurationChangedException::class);
143 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
145 $silentConfigurationUpgradeServiceInstance->_call(
'configureBackendLoginSecurity');
156 [
'',
'rsa',
true,
false],
157 [
'normal',
'rsa',
true,
true],
158 [
'rsa',
'normal',
false,
true],
173 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
174 SilentConfigurationUpgradeService::class,
182 $packageManager = $this->createMock(PackageManager::class);
183 $packageManager->expects($this->any())
184 ->method(
'isPackageActive')
185 ->will($this->returnValue($isPackageActive));
188 $currentLocalConfiguration = [
189 [
'FE/loginSecurityLevel', $current]
191 $closure =
function () {
197 'getLocalConfigurationValueByPath',
198 'setLocalConfigurationValueByPath',
201 if ($hasLocalConfig) {
202 $this->configurationManager->expects($this->once())
203 ->method(
'getLocalConfigurationValueByPath')
204 ->will($this->returnValueMap($currentLocalConfiguration));
206 $this->configurationManager->expects($this->once())
207 ->method(
'getLocalConfigurationValueByPath')
208 ->will($this->returnCallback($closure));
210 if ($isPackageActive ===
false) {
211 $this->configurationManager->expects($this->once())
212 ->method(
'setLocalConfigurationValueByPath')
213 ->with($this->equalTo(
'FE/loginSecurityLevel'), $this->equalTo($setting));
215 $this->expectException(ConfigurationChangedException::class);
218 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
220 $silentConfigurationUpgradeServiceInstance->_call(
'configureFrontendLoginSecurity');
229 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
230 SilentConfigurationUpgradeService::class,
237 $obsoleteLocalConfigurationSettings = [
241 $currentLocalConfiguration = [
242 [$obsoleteLocalConfigurationSettings,
true]
246 'removeLocalConfigurationKeysByPath',
249 $this->configurationManager->expects($this->exactly(1))
250 ->method(
'removeLocalConfigurationKeysByPath')
251 ->will($this->returnValueMap($currentLocalConfiguration));
253 $this->expectException(ConfigurationChangedException::class);
255 $silentConfigurationUpgradeServiceInstance->_set(
'obsoleteLocalConfigurationSettings', $obsoleteLocalConfigurationSettings);
256 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
258 $silentConfigurationUpgradeServiceInstance->_call(
'removeObsoleteLocalConfigurationSettings');
267 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
268 SilentConfigurationUpgradeService::class,
275 $obsoleteLocalConfigurationSettings = [
279 $currentLocalConfiguration = [
280 [$obsoleteLocalConfigurationSettings,
false]
284 'removeLocalConfigurationKeysByPath',
287 $this->configurationManager->expects($this->exactly(1))
288 ->method(
'removeLocalConfigurationKeysByPath')
289 ->will($this->returnValueMap($currentLocalConfiguration));
291 $silentConfigurationUpgradeServiceInstance->_set(
'obsoleteLocalConfigurationSettings', $obsoleteLocalConfigurationSettings);
292 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
294 $silentConfigurationUpgradeServiceInstance->_call(
'removeObsoleteLocalConfigurationSettings');
303 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
304 SilentConfigurationUpgradeService::class,
311 $currentLocalConfiguration = [
312 [
'SYS/encryptionKey',
'EnCrYpTiOnKeY']
317 'getLocalConfigurationValueByPath',
318 'setLocalConfigurationValueByPath',
321 $this->configurationManager->expects($this->exactly(1))
322 ->method(
'getLocalConfigurationValueByPath')
323 ->will($this->returnValueMap($currentLocalConfiguration));
324 $this->configurationManager->expects($this->never())
325 ->method(
'setLocalConfigurationValueByPath');
327 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
329 $silentConfigurationUpgradeServiceInstance->_call(
'generateEncryptionKeyIfNeeded');
338 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
339 SilentConfigurationUpgradeService::class,
346 $closure =
function () {
352 'getLocalConfigurationValueByPath',
353 'setLocalConfigurationValueByPath',
356 $this->configurationManager->expects($this->exactly(1))
357 ->method(
'getLocalConfigurationValueByPath')
358 ->will($this->returnCallback($closure));
359 $this->configurationManager->expects($this->once())
360 ->method(
'setLocalConfigurationValueByPath')
361 ->with($this->equalTo(
'SYS/encryptionKey'), $this->isType(
'string'));
363 $this->expectException(ConfigurationChangedException::class);
365 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
367 $silentConfigurationUpgradeServiceInstance->_call(
'generateEncryptionKeyIfNeeded');
378 'No changes overridden in Local Configuration' => [
380 [
'HTTP/timeout' => 100],
383 'Old and unused settings removed' => [
384 [
'adapter' =>
'curl'],
388 'Old and used settings changed' => [
389 [
'protocol_version' =>
'1.1'],
390 [
'HTTP/version' =>
'1.1'],
395 'Redirects moved to default' => [
396 [
'follow_redirects' =>
true],
400 'Redirects moved #1' => [
401 [
'follow_redirects' =>
true,
'max_redirects' => 200,
'strict_redirects' =>
false],
402 [
'HTTP/allow_redirects' => [
'max' => 200]],
405 'Redirects moved #2' => [
406 [
'follow_redirects' =>
false,
'max_redirects' => 200,
'strict_redirects' =>
false],
407 [
'HTTP/allow_redirects' =>
false],
410 'Redirects moved #3' => [
411 [
'follow_redirects' =>
true,
'max_redirects' => 400,
'strict_redirects' => 1],
412 [
'HTTP/allow_redirects' => [
'max' => 400,
'strict' =>
true]],
417 'Proxy host set' => [
418 [
'proxy_host' =>
'vpn.myproxy.com'],
419 [
'HTTP/proxy' =>
'http://vpn.myproxy.com'],
422 'Proxy host set + port' => [
423 [
'proxy_host' =>
'vpn.myproxy.com',
'proxy_port' => 8080],
424 [
'HTTP/proxy' =>
'http://vpn.myproxy.com:8080'],
427 'Proxy host set + port + verification' => [
428 [
'proxy_host' =>
'vpn.myproxy.com',
'proxy_port' => 8080,
'proxy_auth_scheme' =>
'basic',
'proxy_user' =>
'myuser',
'proxy_password' =>
'mysecret'],
429 [
'HTTP/proxy' =>
'http://myuser:mysecret@vpn.myproxy.com:8080'],
434 'Only ssl_capath set, invalid migration' => [
435 [
'ssl_capath' =>
'/foo/bar/'],
439 'Verification activated, but only ssl_capath set, using default' => [
440 [
'ssl_verify_peer' => 1,
'ssl_capath' =>
'/foo/bar/'],
444 'Verification activated, with ssl_capath and ssl_cafile set' => [
445 [
'ssl_verify_peer' => 1,
'ssl_capath' =>
'/foo/bar/',
'ssl_cafile' =>
'supersecret.crt'],
446 [
'HTTP/verify' =>
'/foo/bar/supersecret.crt'],
451 'SSL key certification' => [
452 [
'ssl_local_cert' =>
'/foo/bar/supersecret.key'],
453 [
'HTTP/ssl_key' =>
'/foo/bar/supersecret.key'],
456 'SSL key certification + passphrase' => [
457 [
'ssl_local_cert' =>
'/foo/bar/supersecret.key',
'ssl_passphrase' =>
'donotcopypasteme'],
458 [
'HTTP/ssl_key' => [
'/foo/bar/supersecret.key',
'donotcopypasteme']],
461 'SSL key passphrase only - no migration' => [
462 [
'ssl_passphrase' =>
'donotcopypasteme'],
479 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
480 SilentConfigurationUpgradeService::class,
489 'setLocalConfigurationValuesByPathValuePairs',
490 'removeLocalConfigurationKeysByPath',
491 'getLocalConfiguration'
495 $this->configurationManager->expects($this->any())
496 ->method(
'getLocalConfiguration')
497 ->willReturn([
'HTTP' => $currentLocalConfiguration]);
498 if ($localConfigurationNeedsUpdate) {
499 if (!empty($newSettings)) {
500 $this->configurationManager->expects($this->once())
501 ->method(
'setLocalConfigurationValuesByPathValuePairs')
502 ->with($newSettings);
504 $this->configurationManager->expects($this->atMost(1))->method(
'removeLocalConfigurationKeysByPath');
507 if ($localConfigurationNeedsUpdate) {
508 $this->expectException(ConfigurationChangedException::class);
511 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
513 $silentConfigurationUpgradeServiceInstance->_call(
'transferHttpSettings');
522 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
523 SilentConfigurationUpgradeService::class,
530 $currentLocalConfiguration = [
533 [
'GFX/im_path_lzw',
''],
534 [
'GFX/imagefile_ext',
'gif,jpg,png'],
535 [
'GFX/thumbnails', 0]
539 'getLocalConfigurationValueByPath',
540 'getDefaultConfigurationValueByPath',
541 'setLocalConfigurationValuesByPathValuePairs',
544 $this->configurationManager->expects($this->exactly(5))
545 ->method(
'getLocalConfigurationValueByPath')
546 ->will($this->returnValueMap($currentLocalConfiguration));
547 $this->configurationManager->expects($this->never())
548 ->method(
'getDefaultConfigurationValueByPath');
549 $this->configurationManager->expects($this->once())
550 ->method(
'setLocalConfigurationValuesByPathValuePairs')
552 [[
'GFX/imagefile_ext' =>
'gif,jpg,jpeg,png']]
555 $this->expectException(ConfigurationChangedException::class);
557 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
559 $silentConfigurationUpgradeServiceInstance->_call(
'disableImageMagickDetailSettingsIfImageMagickIsDisabled');
568 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
569 SilentConfigurationUpgradeService::class,
576 $currentLocalConfiguration = [
579 [
'GFX/im_path_lzw',
''],
580 [
'GFX/imagefile_ext',
'gif,jpg,jpeg,png'],
581 [
'GFX/thumbnails', 0]
585 'getLocalConfigurationValueByPath',
586 'getDefaultConfigurationValueByPath',
587 'setLocalConfigurationValuesByPathValuePairs',
590 $this->configurationManager->expects($this->exactly(5))
591 ->method(
'getLocalConfigurationValueByPath')
592 ->will($this->returnValueMap($currentLocalConfiguration));
593 $this->configurationManager->expects($this->never())
594 ->method(
'getDefaultConfigurationValueByPath');
595 $this->configurationManager->expects($this->never())
596 ->method(
'setLocalConfigurationValuesByPathValuePairs');
598 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
600 $silentConfigurationUpgradeServiceInstance->_call(
'disableImageMagickDetailSettingsIfImageMagickIsDisabled');
609 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
610 SilentConfigurationUpgradeService::class,
617 $currentLocalConfiguration = [
618 [
'GFX/processor',
'GraphicsMagick'],
619 [
'GFX/processor_allowTemporaryMasksAsPng', 1],
620 [
'GFX/processor_effects',
false],
624 'getLocalConfigurationValueByPath',
625 'getDefaultConfigurationValueByPath',
626 'setLocalConfigurationValuesByPathValuePairs',
629 $this->configurationManager->expects($this->exactly(3))
630 ->method(
'getLocalConfigurationValueByPath')
631 ->will($this->returnValueMap($currentLocalConfiguration));
632 $this->configurationManager->expects($this->never())
633 ->method(
'getDefaultConfigurationValueByPath');
634 $this->configurationManager->expects($this->once())
635 ->method(
'setLocalConfigurationValuesByPathValuePairs')
638 'GFX/processor_allowTemporaryMasksAsPng' => 0,
642 $this->expectException(ConfigurationChangedException::class);
644 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
646 $silentConfigurationUpgradeServiceInstance->_call(
'setImageMagickDetailSettings');
655 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
656 SilentConfigurationUpgradeService::class,
663 $currentLocalConfiguration = [
664 [
'GFX/processor',
''],
665 [
'GFX/processor_allowTemporaryMasksAsPng', 0],
666 [
'GFX/processor_effects', 0],
670 'getLocalConfigurationValueByPath',
671 'getDefaultConfigurationValueByPath',
672 'setLocalConfigurationValuesByPathValuePairs',
675 $this->configurationManager->expects($this->exactly(3))
676 ->method(
'getLocalConfigurationValueByPath')
677 ->will($this->returnValueMap($currentLocalConfiguration));
678 $this->configurationManager->expects($this->never())
679 ->method(
'getDefaultConfigurationValueByPath');
680 $this->configurationManager->expects($this->never())
681 ->method(
'setLocalConfigurationValuesByPathValuePairs');
683 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
685 $silentConfigurationUpgradeServiceInstance->_call(
'setImageMagickDetailSettings');
700 $configurationManager->getLocalConfigurationValueByPath(
'GFX/processor_allowTemporaryMasksAsPng')->willReturn(
false);
701 $configurationManager->getLocalConfigurationValueByPath(
'GFX/processor_effects')->willReturn($currentValue);
703 'GFX/processor_effects' => $expectedMigratedValue,
704 ])->shouldBeCalled();
706 $this->expectException(ConfigurationChangedException::class);
710 $this->callInaccessibleMethod($silentConfigurationUpgradeService,
'setImageMagickDetailSettings');
752 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
753 SilentConfigurationUpgradeService::class,
760 $currentLocalConfiguration = [
764 'getLocalConfigurationValueByPath',
765 'setLocalConfigurationValueByPath',
769 $this->configurationManager->expects($this->exactly(1))
770 ->method(
'getLocalConfigurationValueByPath')
771 ->will($this->returnValueMap($currentLocalConfiguration));
772 $this->configurationManager->expects($this->never())
773 ->method(
'setLocalConfigurationValueByPath');
775 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
777 $silentConfigurationUpgradeServiceInstance->_call(
'migrateLangDebug');
786 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
787 SilentConfigurationUpgradeService::class,
794 $currentLocalConfiguration = [
795 [
'BE/lang/debug',
false]
799 'getLocalConfigurationValueByPath',
800 'setLocalConfigurationValueByPath',
804 $this->configurationManager->expects($this->exactly(1))
805 ->method(
'getLocalConfigurationValueByPath')
806 ->will($this->returnValueMap($currentLocalConfiguration));
807 $this->configurationManager->expects($this->once())
808 ->method(
'setLocalConfigurationValueByPath')
809 ->with($this->equalTo(
'BE/languageDebug'),
false);
811 $this->expectException(ConfigurationChangedException::class);
812 $this->expectExceptionCode(1379024938);
814 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager', $this->configurationManager);
815 $silentConfigurationUpgradeServiceInstance->_call(
'migrateLangDebug');
824 'FE/cHashOnlyForParameters' =>
'foo,bar',
825 'FE/cHashExcludedParameters' =>
'bar,foo',
826 'FE/cHashRequiredParameters' =>
'bar,baz',
827 'FE/cHashExcludedParametersIfEmpty' =>
'*'
833 foreach ($oldConfig as $key => $value) {
836 ->willReturn($value);
839 $configurationManager->setLocalConfigurationValuesByPathValuePairs(Argument::cetera())->shouldBeCalled();
842 $this->expectException(ConfigurationChangedException::class);
843 $this->expectExceptionCode(1379024938);
846 $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
847 SilentConfigurationUpgradeService::class,
854 $silentConfigurationUpgradeServiceInstance->_set(
'configurationManager',
$configurationManager->reveal());
855 $silentConfigurationUpgradeServiceInstance->_call(
'migrateCacheHashOptions');
863 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
865 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXTENSIONS/saltedpasswords')
866 ->shouldBeCalled()->willThrow($configurationManagerException);
867 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXT/extConf/saltedpasswords')
868 ->shouldBeCalled()->willThrow($configurationManagerException);
869 $configurationManagerProphecy->setLocalConfigurationValuesByPathValuePairs(Argument::cetera())
870 ->shouldNotBeCalled();
871 $silentConfigurationUpgradeService = $this->getAccessibleMock(
872 SilentConfigurationUpgradeService::class,
874 [$configurationManagerProphecy->reveal()]
876 $silentConfigurationUpgradeService->_call(
'migrateSaltedPasswordsSettings');
884 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
885 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXTENSIONS/saltedpasswords')
886 ->shouldBeCalled()->willReturn([]);
887 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXT/extConf/saltedpasswords')
888 ->shouldBeCalled()->willReturn(
'');
889 $configurationManagerProphecy->setLocalConfigurationValuesByPathValuePairs(Argument::cetera())
890 ->shouldNotBeCalled();
891 $silentConfigurationUpgradeService = $this->getAccessibleMock(
892 SilentConfigurationUpgradeService::class,
894 [$configurationManagerProphecy->reveal()]
896 $silentConfigurationUpgradeService->_call(
'migrateSaltedPasswordsSettings');
904 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
906 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXTENSIONS/saltedpasswords')
907 ->shouldBeCalled()->willReturn([
'thereIs' =>
'something']);
908 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXT/extConf/saltedpasswords')
909 ->shouldBeCalled()->willThrow($configurationManagerException);
910 $argonBeProphecy = $this->prophesize(Argon2iPasswordHash::class);
911 $argonBeProphecy->isAvailable()->shouldBeCalled()->willReturn(
true);
912 GeneralUtility::addInstance(Argon2iPasswordHash::class, $argonBeProphecy->reveal());
913 $argonFeProphecy = $this->prophesize(Argon2iPasswordHash::class);
914 $argonFeProphecy->isAvailable()->shouldBeCalled()->willReturn(
true);
915 GeneralUtility::addInstance(Argon2iPasswordHash::class, $argonFeProphecy->reveal());
916 $configurationManagerProphecy->removeLocalConfigurationKeysByPath([
'EXTENSIONS/saltedpasswords'])
918 $silentConfigurationUpgradeService = $this->getAccessibleMock(
919 SilentConfigurationUpgradeService::class,
921 [$configurationManagerProphecy->reveal()]
923 $this->expectException(ConfigurationChangedException::class);
924 $this->expectExceptionCode(1379024938);
925 $silentConfigurationUpgradeService->_call(
'migrateSaltedPasswordsSettings');
933 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
935 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXTENSIONS/saltedpasswords')
936 ->shouldBeCalled()->willThrow($configurationManagerException);
937 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXT/extConf/saltedpasswords')
938 ->shouldBeCalled()->willReturn(
'someConfiguration');
939 $argonBeProphecy = $this->prophesize(Argon2iPasswordHash::class);
940 $argonBeProphecy->isAvailable()->shouldBeCalled()->willReturn(
true);
941 GeneralUtility::addInstance(Argon2iPasswordHash::class, $argonBeProphecy->reveal());
942 $argonFeProphecy = $this->prophesize(Argon2iPasswordHash::class);
943 $argonFeProphecy->isAvailable()->shouldBeCalled()->willReturn(
true);
944 GeneralUtility::addInstance(Argon2iPasswordHash::class, $argonFeProphecy->reveal());
945 $configurationManagerProphecy->removeLocalConfigurationKeysByPath([
'EXT/extConf/saltedpasswords'])
947 $silentConfigurationUpgradeService = $this->getAccessibleMock(
948 SilentConfigurationUpgradeService::class,
950 [$configurationManagerProphecy->reveal()]
952 $this->expectException(ConfigurationChangedException::class);
953 $this->expectExceptionCode(1379024938);
954 $silentConfigurationUpgradeService->_call(
'migrateSaltedPasswordsSettings');
962 $configurationManagerProphecy = $this->prophesize(ConfigurationManager::class);
963 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXTENSIONS/saltedpasswords')
964 ->shouldBeCalled()->willReturn([
'thereIs' =>
'something']);
965 $configurationManagerProphecy->getLocalConfigurationValueByPath(
'EXT/extConf/saltedpasswords')
966 ->shouldBeCalled()->willReturn(
'someConfiguration');
967 $argonBeProphecy = $this->prophesize(Argon2iPasswordHash::class);
968 $argonBeProphecy->isAvailable()->shouldBeCalled()->willReturn(
false);
969 GeneralUtility::addInstance(Argon2iPasswordHash::class, $argonBeProphecy->reveal());
970 $bcryptBeProphecy = $this->prophesize(BcryptPasswordHash::class);
971 $bcryptBeProphecy->isAvailable()->shouldBeCalled()->willReturn(
true);
972 GeneralUtility::addInstance(BcryptPasswordHash::class, $bcryptBeProphecy->reveal());
973 $argonFeProphecy = $this->prophesize(Argon2iPasswordHash::class);
974 $argonFeProphecy->isAvailable()->shouldBeCalled()->willReturn(
false);
975 GeneralUtility::addInstance(Argon2iPasswordHash::class, $argonFeProphecy->reveal());
976 $bcryptFeProphecy = $this->prophesize(BcryptPasswordHash::class);
977 $bcryptFeProphecy->isAvailable()->shouldBeCalled()->willReturn(
true);
978 GeneralUtility::addInstance(BcryptPasswordHash::class, $bcryptFeProphecy->reveal());
979 $configurationManagerProphecy->setLocalConfigurationValuesByPathValuePairs([
980 'BE/passwordHashing/className' => BcryptPasswordHash::class,
981 'FE/passwordHashing/className' => BcryptPasswordHash::class,
982 ])->shouldBeCalled();
983 $configurationManagerProphecy->removeLocalConfigurationKeysByPath([
'EXTENSIONS/saltedpasswords',
'EXT/extConf/saltedpasswords'])
985 $silentConfigurationUpgradeService = $this->getAccessibleMock(
986 SilentConfigurationUpgradeService::class,
988 [$configurationManagerProphecy->reveal()]
990 $this->expectException(ConfigurationChangedException::class);
991 $this->expectExceptionCode(1379024938);
992 $silentConfigurationUpgradeService->_call(
'migrateSaltedPasswordsSettings');