diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php index 99e41497faa19d59ae7c9574d0ce058624a33caf..7ad9352760ae7833dd75bf34ce4b2bf477475013 100644 --- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php +++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php @@ -3483,9 +3483,6 @@ class GeneralUtility ) { return array_shift(self::$nonSingletonInstances[$finalClassName]); } - if (!class_exists($finalClassName)) { - throw new \InvalidArgumentException('Class "' . $className . '" not found', 1503060454); - } // Create new instance and call constructor with parameters $instance = new $finalClassName(...$constructorArguments); // Register new singleton instance diff --git a/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php b/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php index 9d77dace880bb97bbf4468b3286a687d0999b5a3..bc708d0e0d671a810817c222cef33d008e3dc85f 100644 --- a/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php +++ b/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php @@ -3771,31 +3771,6 @@ class GeneralUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase GeneralUtility::makeInstance(['foo']); } - /** - * @test - */ - public function makeInstanceWithUnknownClassThrowsException() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionCode(1503060454); - - GeneralUtility::makeInstance('UnknownClass' . time()); - } - - /** - * @test - */ - public function makeInstanceWithUnknownClassImplementationThrowsException() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionCode(1503060454); - - GeneralUtilityFixture::resetFinalClassNameCache(); - $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][OriginalClassFixture::class] = ['className' => 'UnknownClass' . time()]; - - GeneralUtility::makeInstance(OriginalClassFixture::class); - } - /** * @test */