File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -177,5 +177,13 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class)
177
177
// @todo find a non-hack way to pass the Drupal roots to the bootstrap file.
178
178
$ class ->getMethod ('initialize ' )->addBody ('$GLOBALS["drupalRoot"] = ?; ' , [$ this ->drupalRoot ]);
179
179
$ class ->getMethod ('initialize ' )->addBody ('$GLOBALS["drupalVendorDir"] = ?; ' , [$ this ->drupalVendorDir ]);
180
+
181
+ // DRUPAL_TEST_IN_CHILD_SITE is only defined in the \Drupal\Core\DrupalKernel::bootEnvironment method when
182
+ // Drupal is bootstrapped. Since we don't actually invoke the bootstrapping of Drupal, define the constant here
183
+ // as `false`. And we have to conditionally define it due to our own PHPUnit tests
184
+ $ class ->getMethod ('initialize ' )->addBody ('
185
+ if (!defined("DRUPAL_TEST_IN_CHILD_SITE")) {
186
+ define("DRUPAL_TEST_IN_CHILD_SITE", ?);
187
+ } ' , [false ]);
180
188
}
181
189
}
Original file line number Diff line number Diff line change 1
1
parameters :
2
+ reportUnmatchedIgnoredErrors : false
2
3
level : 7
4
+ # Ignore functions for the PHPUnit bootstrap process.
5
+ ignoreErrors :
6
+ - ' #Function drupal_phpunit_[a-zA-Z0-9\\_ ]+ not found #'
3
7
drupal :
4
8
drupal_root : %currentWorkingDirectory%
5
9
includes :
6
10
- ../../../extension.neon
11
+ - ../../../vendor/phpstan/phpstan/conf/config.level2.neon
7
12
- ../../../vendor/phpstan/phpstan-deprecation-rules/rules.neon
You can’t perform that action at this time.
0 commit comments