[BUGFIX] Simplify test setup to avoid double exception codes 61/59061/5
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 8 Dec 2018 10:50:46 +0000 (11:50 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 8 Dec 2018 15:29:41 +0000 (16:29 +0100)
The setup just needs to make sure the exception is expected.
More details are not required.

Change-Id: Id9c27078ddeb2817f3d34c4134c0eca4aa20589a
Resolves: #87108
Relates: #87103
Releases: 8.7
Reviewed-on: https://review.typo3.org/59061
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Joerg Kummer <typo3@enobe.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Joerg Kummer <typo3@enobe.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php

index 3fc9689..6716a3a 100644 (file)
@@ -105,9 +105,6 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\TestingFramework\Core
         $currentLocalConfiguration = [
             ['BE/loginSecurityLevel', $current]
         ];
-        $closure = function () {
-            throw new \RuntimeException('Path does not exist in array', 1476109311);
-        };
 
         $this->createConfigurationManagerWithMockedMethods(
             [
@@ -122,7 +119,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\TestingFramework\Core
         } else {
             $this->configurationManager->expects($this->once())
                 ->method('getLocalConfigurationValueByPath')
-                ->will($this->returnCallback($closure));
+                ->willThrowException(new \RuntimeException('testing', 1544278754));
         }
         $this->configurationManager->expects($this->once())
             ->method('setLocalConfigurationValueByPath')
@@ -178,9 +175,6 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\TestingFramework\Core
         $currentLocalConfiguration = [
             ['FE/loginSecurityLevel', $current]
         ];
-        $closure = function () {
-            throw new \RuntimeException('Path does not exist in array', 1476109311);
-        };
 
         $this->createConfigurationManagerWithMockedMethods(
             [
@@ -195,7 +189,7 @@ class SilentConfigurationUpgradeServiceTest extends \TYPO3\TestingFramework\Core
         } else {
             $this->configurationManager->expects($this->once())
                 ->method('getLocalConfigurationValueByPath')
-                ->will($this->returnCallback($closure));
+                ->willThrowException(new \RuntimeException('testing', 1544278778));
         }
         if (!$isPackageActive) {
             $this->configurationManager->expects($this->once())