[TASK] Add missing unit tests for SilentConfigurationUpgradeService 87/42487/5
authorMichael Oehlhof <typo3@oehlhof.de>
Mon, 10 Aug 2015 18:06:24 +0000 (20:06 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 18 Aug 2015 22:36:31 +0000 (00:36 +0200)
Missing unit tests for GFX settings are added:
disableImageMagickAndGdlibIfImageProcessingIsDisabled()
disableImageMagickDetailSettingsIfImageMagickIsDisabled()
setImageMagickDetailSettings()

Resolves: #68913
Releases: master
Change-Id: I45a4e7ed4d614bd6e657c714a09d8251f25eff25
Reviewed-on: http://review.typo3.org/42487
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php

index f51bbf4..31b86de 100644 (file)
@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Install\Service;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Configuration\ConfigurationManager;
+use TYPO3\CMS\Core\Package\PackageManager;
 use TYPO3\CMS\Install\Controller\Exception\RedirectException;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 
@@ -24,7 +26,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
-        * @var \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject
+        * @var ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject
         */
        protected $configurationManager;
 
@@ -33,7 +35,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         */
        protected function createConfigurationManagerWithMockedMethods(array $methods) {
                $this->configurationManager = $this->getMock(
-                       \TYPO3\CMS\Core\Configuration\ConfigurationManager::class,
+                       ConfigurationManager::class,
                        $methods
                );
        }
@@ -54,19 +56,23 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
        /**
         * @test
         * @dataProvider configureBackendLoginSecurityLocalconfiguration
+        * @param string $current
+        * @param string $setting
+        * @param bool $isPackageActive
+        * @param bool $hasLocalConfig
         */
        public function configureBackendLoginSecurity($current, $setting, $isPackageActive, $hasLocalConfig) {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
                        FALSE
                );
 
-               /** @var $packageManager \TYPO3\CMS\Core\Package\PackageManager|\PHPUnit_Framework_MockObject_MockObject */
-               $packageManager = $this->getMock(\TYPO3\CMS\Core\Package\PackageManager::class, array(), array(), '', FALSE);
+               /** @var $packageManager PackageManager|\PHPUnit_Framework_MockObject_MockObject */
+               $packageManager = $this->getMock(PackageManager::class, array(), array(), '', FALSE);
                $packageManager->expects($this->any())
                        ->method('isPackageActive')
                        ->will($this->returnValue($isPackageActive));
@@ -98,7 +104,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                        ->method('setLocalConfigurationValueByPath')
                        ->with($this->equalTo('BE/loginSecurityLevel'), $this->equalTo($setting));
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
 
@@ -109,9 +115,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function removeObsoleteLocalConfigurationSettingsIfThereAreOldSettings() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -134,7 +140,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                        ->method('removeLocalConfigurationKeysByPath')
                        ->will($this->returnValueMap($currentLocalConfiguration));
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('obsoleteLocalConfigurationSettings', $obsoleteLocalConfigurationSettings);
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
@@ -146,9 +152,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function doNotRemoveObsoleteLocalConfigurationSettingsIfThereAreNoOldSettings() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -181,9 +187,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function configureSaltedPasswordsWithDefaultConfiguration() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -214,7 +220,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                        ->method('setLocalConfigurationValueByPath')
                        ->with($this->equalTo('EXT/extConf/saltedpasswords'), $this->equalTo($config));
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
 
@@ -225,9 +231,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function configureSaltedPasswordsWithExtensionConfigurationBeEnabled() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -258,7 +264,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                        ->method('setLocalConfigurationValueByPath')
                        ->with($this->equalTo('EXT/extConf/saltedpasswords'), $this->equalTo($newConfig));
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
 
@@ -269,9 +275,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function configureSaltedPasswordsWithExtensionConfigurationBeNotEnabled() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -302,7 +308,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                        ->method('setLocalConfigurationValueByPath')
                        ->with($this->equalTo('EXT/extConf/saltedpasswords'), $this->equalTo($newConfig));
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
 
@@ -313,16 +319,16 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function noProxyAuthSchemeSetInLocalConfiguration() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
                        FALSE
                );
 
-               $closure = function ($param) {
+               $closure = function () {
                        throw new \RuntimeException('Path does not exist in array', 1341397869);
                };
 
@@ -347,9 +353,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function proxyAuthSchemeIsDigest() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -381,9 +387,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function proxyAuthSchemeIsBasic() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -407,7 +413,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                        ->method('removeLocalConfigurationKeysByPath')
                        ->with($this->equalTo(array('HTTP/proxy_auth_scheme')));
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
 
@@ -418,9 +424,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function doNotGenerateEncryptionKeyIfExists() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -452,9 +458,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function generateEncryptionKeyIfNotExists() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -478,7 +484,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                        ->method('setLocalConfigurationValueByPath')
                        ->with($this->equalTo('SYS/encryptionKey'), $this->isType('string'));
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
 
@@ -502,11 +508,14 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
        /**
         * @test
         * @dataProvider curlProxySettingsToHttpSettingsMapping
+        * @param string $curlProxyServer
+        * @param string $proxyHost
+        * @param string $proxyPort
         */
        public function transferDeprecatedCurlSettings($curlProxyServer, $proxyHost, $proxyPort) {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -537,7 +546,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                                array('HTTP/proxy_port', $proxyPort)
                        );
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
 
@@ -548,9 +557,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function curlProxyServerDoesNotOverwriteHttpSettings() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -588,9 +597,9 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
         * @test
         */
        public function curlAdapterUsedIfCurlUse() {
-               /** @var $silentConfigurationUpgradeServiceInstance \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
-                       \TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService::class,
+                       SilentConfigurationUpgradeService::class,
                        array('dummy'),
                        array(),
                        '',
@@ -620,11 +629,356 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\CMS\Core\Tests\UnitTe
                                array('HTTP/adapter', 'curl')
                        );
 
-               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+               $this->setExpectedException(RedirectException::class);
 
                $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
 
                $silentConfigurationUpgradeServiceInstance->_call('transferDeprecatedCurlSettings');
        }
 
+       /**
+        * @test
+        */
+       public function disableImageMagickIfImageProcessingIsDisabled() {
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+                       SilentConfigurationUpgradeService::class,
+                       array('dummy'),
+                       array(),
+                       '',
+                       FALSE
+               );
+
+               $currentLocalConfiguration = array(
+                       array('GFX/image_processing', 0),
+                       array('GFX/im', 1),
+                       array('GFX/gdlib', 0)
+               );
+               $this->createConfigurationManagerWithMockedMethods(
+                       array(
+                               'getLocalConfigurationValueByPath',
+                               'getDefaultConfigurationValueByPath',
+                               'setLocalConfigurationValuesByPathValuePairs',
+                       )
+               );
+               $this->configurationManager->expects($this->exactly(3))
+                       ->method('getLocalConfigurationValueByPath')
+                       ->will($this->returnValueMap($currentLocalConfiguration));
+               $this->configurationManager->expects($this->never())
+                       ->method('getDefaultConfigurationValueByPath');
+               $this->configurationManager->expects($this->once())
+                       ->method('setLocalConfigurationValuesByPathValuePairs')
+                       ->withConsecutive(
+                               array(array('GFX/im' => 0))
+                       );
+
+               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+
+               $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
+
+               $silentConfigurationUpgradeServiceInstance->_call('disableImageMagickAndGdlibIfImageProcessingIsDisabled');
+       }
+
+       /**
+        * @test
+        */
+       public function disableGdlibIfImageProcessingIsDisabled() {
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+                       SilentConfigurationUpgradeService::class,
+                       array('dummy'),
+                       array(),
+                       '',
+                       FALSE
+               );
+
+               $currentLocalConfiguration = array(
+                       array('GFX/image_processing', 0),
+                       array('GFX/im', 0),
+                       array('GFX/gdlib', 1)
+               );
+               $this->createConfigurationManagerWithMockedMethods(
+                       array(
+                               'getLocalConfigurationValueByPath',
+                               'getDefaultConfigurationValueByPath',
+                               'setLocalConfigurationValuesByPathValuePairs',
+                       )
+               );
+               $this->configurationManager->expects($this->exactly(3))
+                       ->method('getLocalConfigurationValueByPath')
+                       ->will($this->returnValueMap($currentLocalConfiguration));
+               $this->configurationManager->expects($this->never())
+                       ->method('getDefaultConfigurationValueByPath');
+               $this->configurationManager->expects($this->once())
+                       ->method('setLocalConfigurationValuesByPathValuePairs')
+                       ->withConsecutive(
+                               array(array('GFX/gdlib' => 0))
+                       );
+
+               $this->setExpectedException(\TYPO3\CMS\Install\Controller\Exception\RedirectException::class);
+
+               $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
+
+               $silentConfigurationUpgradeServiceInstance->_call('disableImageMagickAndGdlibIfImageProcessingIsDisabled');
+       }
+
+       /**
+        * @test
+        */
+       public function doNotDisableImageMagickAndGdlibIfImageProcessingIsEnabled() {
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+                       SilentConfigurationUpgradeService::class,
+                       array('dummy'),
+                       array(),
+                       '',
+                       FALSE
+               );
+
+               $currentLocalConfiguration = array(
+                       array('GFX/image_processing', 1),
+                       array('GFX/im', 1),
+                       array('GFX/gdlib', 1)
+               );
+               $this->createConfigurationManagerWithMockedMethods(
+                       array(
+                               'getLocalConfigurationValueByPath',
+                               'getDefaultConfigurationValueByPath',
+                               'setLocalConfigurationValuesByPathValuePairs',
+                       )
+               );
+               $this->configurationManager->expects($this->exactly(3))
+                       ->method('getLocalConfigurationValueByPath')
+                       ->will($this->returnValueMap($currentLocalConfiguration));
+               $this->configurationManager->expects($this->never())
+                       ->method('getDefaultConfigurationValueByPath');
+               $this->configurationManager->expects($this->never())
+                       ->method('setLocalConfigurationValuesByPathValuePairs');
+
+               $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
+
+               $silentConfigurationUpgradeServiceInstance->_call('disableImageMagickAndGdlibIfImageProcessingIsDisabled');
+       }
+
+       /**
+        * @test
+        */
+       public function disableImageMagickIfDefaultImageProcessingIsDisabled() {
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+                       SilentConfigurationUpgradeService::class,
+                       array('dummy'),
+                       array(),
+                       '',
+                       FALSE
+               );
+
+               $currentDefaultConfiguration = array(
+                       array('GFX/image_processing', 0),
+               );
+               $closure = function ($param) {
+                       switch ($param) {
+                               case 'GFX/im':
+                                       return '1';
+                                       break;
+                               case 'GFX/gdlib':
+                                       return '0';
+                                       break;
+                               default:
+                                       throw new \RuntimeException('Path does not exist in array', 1341397869);
+                       }
+               };
+
+               $this->createConfigurationManagerWithMockedMethods(
+                       array(
+                               'getLocalConfigurationValueByPath',
+                               'getDefaultConfigurationValueByPath',
+                               'setLocalConfigurationValuesByPathValuePairs',
+                       )
+               );
+               $this->configurationManager->expects($this->exactly(3))
+                       ->method('getLocalConfigurationValueByPath')
+                       ->will($this->returnCallback($closure));
+               $this->configurationManager->expects($this->exactly(1))
+                       ->method('getDefaultConfigurationValueByPath')
+                       ->will($this->returnValueMap($currentDefaultConfiguration));
+               $this->configurationManager->expects($this->once())
+                       ->method('setLocalConfigurationValuesByPathValuePairs')
+                       ->withConsecutive(
+                               array(array('GFX/im' => 0))
+                       );
+
+               $this->setExpectedException(RedirectException::class);
+
+               $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
+
+               $silentConfigurationUpgradeServiceInstance->_call('disableImageMagickAndGdlibIfImageProcessingIsDisabled');
+       }
+
+       /**
+        * @test
+        */
+       public function disableImageMagickDetailSettingsIfImageMagickIsDisabled() {
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+                       SilentConfigurationUpgradeService::class,
+                       array('dummy'),
+                       array(),
+                       '',
+                       FALSE
+               );
+
+               $currentLocalConfiguration = array(
+                       array('GFX/im', 0),
+                       array('GFX/im_path', ''),
+                       array('GFX/im_path_lzw', ''),
+                       array('GFX/imagefile_ext', 'gif,jpg,png'),
+                       array('GFX/thumbnails', 0)
+               );
+               $this->createConfigurationManagerWithMockedMethods(
+                       array(
+                               'getLocalConfigurationValueByPath',
+                               'getDefaultConfigurationValueByPath',
+                               'setLocalConfigurationValuesByPathValuePairs',
+                       )
+               );
+               $this->configurationManager->expects($this->exactly(5))
+                       ->method('getLocalConfigurationValueByPath')
+                       ->will($this->returnValueMap($currentLocalConfiguration));
+               $this->configurationManager->expects($this->never())
+                       ->method('getDefaultConfigurationValueByPath');
+               $this->configurationManager->expects($this->once())
+                       ->method('setLocalConfigurationValuesByPathValuePairs')
+                       ->withConsecutive(
+                               array(array('GFX/imagefile_ext' => 'gif,jpg,jpeg,png'))
+                       );
+
+               $this->setExpectedException(RedirectException::class);
+
+               $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
+
+               $silentConfigurationUpgradeServiceInstance->_call('disableImageMagickDetailSettingsIfImageMagickIsDisabled');
+       }
+
+       /**
+        * @test
+        */
+       public function doNotDisableImageMagickDetailSettingsIfImageMagickIsEnabled() {
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+                       SilentConfigurationUpgradeService::class,
+                       array('dummy'),
+                       array(),
+                       '',
+                       FALSE
+               );
+
+               $currentLocalConfiguration = array(
+                       array('GFX/im', 1),
+                       array('GFX/im_path', ''),
+                       array('GFX/im_path_lzw', ''),
+                       array('GFX/imagefile_ext', 'gif,jpg,jpeg,png'),
+                       array('GFX/thumbnails', 0)
+               );
+               $this->createConfigurationManagerWithMockedMethods(
+                       array(
+                               'getLocalConfigurationValueByPath',
+                               'getDefaultConfigurationValueByPath',
+                               'setLocalConfigurationValuesByPathValuePairs',
+                       )
+               );
+               $this->configurationManager->expects($this->exactly(5))
+                       ->method('getLocalConfigurationValueByPath')
+                       ->will($this->returnValueMap($currentLocalConfiguration));
+               $this->configurationManager->expects($this->never())
+                       ->method('getDefaultConfigurationValueByPath');
+               $this->configurationManager->expects($this->never())
+                       ->method('setLocalConfigurationValuesByPathValuePairs');
+
+               $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
+
+               $silentConfigurationUpgradeServiceInstance->_call('disableImageMagickDetailSettingsIfImageMagickIsDisabled');
+       }
+
+       /**
+        * @test
+        */
+       public function setImageMagickDetailSettings() {
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+                       SilentConfigurationUpgradeService::class,
+                       array('dummy'),
+                       array(),
+                       '',
+                       FALSE
+               );
+
+               $currentLocalConfiguration = array(
+                       array('GFX/im_version_5', 'gm'),
+                       array('GFX/im_mask_temp_ext_gif', 0),
+                       array('GFX/im_v5effects', 0)
+               );
+               $this->createConfigurationManagerWithMockedMethods(
+                       array(
+                               'getLocalConfigurationValueByPath',
+                               'getDefaultConfigurationValueByPath',
+                               'setLocalConfigurationValuesByPathValuePairs',
+                       )
+               );
+               $this->configurationManager->expects($this->exactly(3))
+                       ->method('getLocalConfigurationValueByPath')
+                       ->will($this->returnValueMap($currentLocalConfiguration));
+               $this->configurationManager->expects($this->never())
+                       ->method('getDefaultConfigurationValueByPath');
+               $this->configurationManager->expects($this->once())
+                       ->method('setLocalConfigurationValuesByPathValuePairs')
+                       ->withConsecutive(
+                               array(array('GFX/im_mask_temp_ext_gif' => 1,
+                                                       'GFX/im_v5effects' => -1))
+                       );
+
+               $this->setExpectedException(RedirectException::class);
+
+               $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
+
+               $silentConfigurationUpgradeServiceInstance->_call('setImageMagickDetailSettings');
+       }
+
+       /**
+        * @test
+        */
+       public function doNotSetImageMagickDetailSettings() {
+               /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
+               $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(
+                       SilentConfigurationUpgradeService::class,
+                       array('dummy'),
+                       array(),
+                       '',
+                       FALSE
+               );
+
+               $currentLocalConfiguration = array(
+                       array('GFX/im_version_5', ''),
+                       array('GFX/im_mask_temp_ext_gif', 0),
+                       array('GFX/im_v5effects', 0)
+               );
+               $this->createConfigurationManagerWithMockedMethods(
+                       array(
+                               'getLocalConfigurationValueByPath',
+                               'getDefaultConfigurationValueByPath',
+                               'setLocalConfigurationValuesByPathValuePairs',
+                       )
+               );
+               $this->configurationManager->expects($this->exactly(3))
+                       ->method('getLocalConfigurationValueByPath')
+                       ->will($this->returnValueMap($currentLocalConfiguration));
+               $this->configurationManager->expects($this->never())
+                       ->method('getDefaultConfigurationValueByPath');
+               $this->configurationManager->expects($this->never())
+                       ->method('setLocalConfigurationValuesByPathValuePairs');
+
+               $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
+
+               $silentConfigurationUpgradeServiceInstance->_call('setImageMagickDetailSettings');
+       }
 }