@@ -59,6 +59,7 @@ class FunctionalTestCaseBootstrapUtility
5959 'lang ' ,
6060 'extbase ' ,
6161 'install ' ,
62+ 'cms ' ,
6263 ];
6364
6465 /**
@@ -425,11 +426,13 @@ protected function setUpPackageStates(array $coreExtensionsToLoad, array $testEx
425426
426427 // Register default list of extensions and set active
427428 foreach ($ this ->defaultActivatedCoreExtensions as $ extensionName ) {
428- $ packageStates ['packages ' ][$ extensionName ] = [
429- 'state ' => 'active ' ,
430- 'packagePath ' => 'typo3/sysext/ ' . $ extensionName . '/ ' ,
431- 'classesPath ' => 'Classes/ ' ,
432- ];
429+ if (is_dir ($ this ->instancePath . '/typo3/sysext/ ' . $ extensionName )) {
430+ $ packageStates ['packages ' ][$ extensionName ] = [
431+ 'state ' => 'active ' ,
432+ 'packagePath ' => 'typo3/sysext/ ' . $ extensionName . '/ ' ,
433+ 'classesPath ' => 'Classes/ ' ,
434+ ];
435+ }
433436 }
434437
435438 // Register additional core extensions and set active
@@ -491,15 +494,28 @@ protected function setUpBasicTypo3Bootstrap()
491494 define ('TYPO3_MODE ' , 'BE ' );
492495 define ('TYPO3_cliMode ' , true );
493496
494- $ classLoader = require rtrim (realpath ($ this ->instancePath . '/typo3/ ' ), '\\/ ' ) . '/../vendor/autoload.php ' ;
495- \TYPO3 \CMS \Core \Core \Bootstrap::getInstance ()
496- ->initializeClassLoader ($ classLoader )
497- ->baseSetup ('' )
498- ->loadConfigurationAndInitialize (true )
499- ->loadTypo3LoadedExtAndExtLocalconf (true )
500- ->setFinalCachingFrameworkCacheConfiguration ()
501- ->defineLoggingAndExceptionConstants ()
502- ->unsetReservedGlobalVariables ();
497+ $ autoloadFilepath = rtrim (realpath ($ this ->instancePath . '/typo3/ ' ), '\\/ ' ) . '/../vendor/autoload.php ' ;
498+ if (file_exists ($ autoloadFilepath )) {
499+ $ classLoader = require $ autoloadFilepath ;
500+ Bootstrap::getInstance ()
501+ ->initializeClassLoader ($ classLoader )
502+ ->baseSetup ('' )
503+ ->loadConfigurationAndInitialize (true )
504+ ->loadTypo3LoadedExtAndExtLocalconf (true )
505+ ->setFinalCachingFrameworkCacheConfiguration ()
506+ ->defineLoggingAndExceptionConstants ()
507+ ->unsetReservedGlobalVariables ();
508+ } else {
509+ require_once $ this ->instancePath . '/typo3/sysext/core/Classes/Core/CliBootstrap.php ' ;
510+ \TYPO3 \CMS \Core \Core \CliBootstrap::checkEnvironmentOrDie ();
511+
512+ require_once $ this ->instancePath . '/typo3/sysext/core/Classes/Core/Bootstrap.php ' ;
513+ Bootstrap::getInstance ()
514+ ->baseSetup ('' )
515+ ->loadConfigurationAndInitialize (true )
516+ ->loadTypo3LoadedExtAndExtLocalconf (true )
517+ ->applyAdditionalConfigurationSettings ();
518+ }
503519 }
504520
505521 /**
0 commit comments