diff --git a/resources/build.defaults.yaml b/resources/build.defaults.yaml index 8de91e4..dc1f09e 100644 --- a/resources/build.defaults.yaml +++ b/resources/build.defaults.yaml @@ -2,6 +2,7 @@ drupal: docroot: web experimental: + runStaticAnalysisOnTests: false useNewDatabaseCredentials: true project_root: /app diff --git a/src/DataTransferObject/Config.php b/src/DataTransferObject/Config.php index b25973c..6a9f38b 100644 --- a/src/DataTransferObject/Config.php +++ b/src/DataTransferObject/Config.php @@ -120,6 +120,10 @@ final class Config new Assert\Type('bool'), ]), + 'runStaticAnalysisOnTests' => new Assert\Optional([ + new Assert\Type('bool'), + ]), + // TODO: remove this when its been removed from all `build.yaml` files. 'useNewDatabaseCredentials' => new Assert\Optional([ new Assert\Type('bool'), diff --git a/templates/drupal/phpstan.neon.dist.twig b/templates/drupal/phpstan.neon.dist.twig index a4abb27..4bd4c2e 100644 --- a/templates/drupal/phpstan.neon.dist.twig +++ b/templates/drupal/phpstan.neon.dist.twig @@ -2,9 +2,11 @@ parameters: level: {{ php.phpstan.level }} +{% if not experimental.runStaticAnalysisOnTests %} excludePaths: - *Test.php - *TestBase.php +{% endif %} paths: {% for path in php.phpstan.paths -%} - {{ path }}