File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -100,14 +100,18 @@ public function register(Container $container): void
100
100
$ this ->addThemeNamespaces ();
101
101
$ this ->registerPs4Namespaces ($ this ->namespaces );
102
102
$ this ->loadLegacyIncludes ();
103
- require_once $ this ->drupalRoot . '/core/tests/bootstrap.php ' ;
104
-
105
- // class_alias is not supported by OptimizedDirectorySourceLocator or AutoloadSourceLocator,
106
- // so we manually load this PHPUnit compatibility trait that exists in Drupal 8.
107
- $ phpunitCompatTraitFilepath = $ this ->drupalRoot . '/core/tests/Drupal/Tests/PhpunitCompatibilityTrait.php ' ;
108
- if (file_exists ($ phpunitCompatTraitFilepath )) {
109
- require_once $ phpunitCompatTraitFilepath ;
110
- $ this ->autoloader ->addClassMap (['Drupal \\Tests \\PhpunitCompatibilityTrait ' => $ phpunitCompatTraitFilepath ]);
103
+
104
+ // @todo stop requiring the bootstrap.php and just copy what is needed.
105
+ if (interface_exists (\PHPUnit \Framework \Test::class)) {
106
+ require_once $ this ->drupalRoot . '/core/tests/bootstrap.php ' ;
107
+
108
+ // class_alias is not supported by OptimizedDirectorySourceLocator or AutoloadSourceLocator,
109
+ // so we manually load this PHPUnit compatibility trait that exists in Drupal 8.
110
+ $ phpunitCompatTraitFilepath = $ this ->drupalRoot . '/core/tests/Drupal/Tests/PhpunitCompatibilityTrait.php ' ;
111
+ if (file_exists ($ phpunitCompatTraitFilepath )) {
112
+ require_once $ phpunitCompatTraitFilepath ;
113
+ $ this ->autoloader ->addClassMap (['Drupal \\Tests \\PhpunitCompatibilityTrait ' => $ phpunitCompatTraitFilepath ]);
114
+ }
111
115
}
112
116
113
117
foreach ($ this ->moduleData as $ extension ) {
You can’t perform that action at this time.
0 commit comments