Browse Source

Use phpstan level 1 to check basic tests sanity.

mscherer 4 years ago
parent
commit
aaccae1c32
3 changed files with 15 additions and 0 deletions
  1. 4 0
      .github/workflows/ci.yml
  2. 1 0
      composer.json
  3. 10 0
      tests/phpstan.neon

+ 4 - 0
.github/workflows/ci.yml

@@ -247,3 +247,7 @@ jobs:
     - name: Run phpstan
       if: success() || failure()
       run: vendor/bin/phpstan.phar analyse --error-format=github
+
+    - name: Run phpstan for tests
+      if: success() || failure()
+      run: vendor/bin/phpstan.phar analyse -c tests/phpstan.neon --error-format=github

+ 1 - 0
composer.json

@@ -109,6 +109,7 @@
             "@phpstan",
             "@psalm"
         ],
+        "stan-tests": "phpstan.phar analyze -c tests/phpstan.neon",
         "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:0.12.96 psalm/phar:~4.10.0 && mv composer.backup composer.json",
         "test": "phpunit",
         "test-coverage": "phpunit --coverage-clover=clover.xml"

+ 10 - 0
tests/phpstan.neon

@@ -0,0 +1,10 @@
+parameters:
+	level: 1
+	treatPhpDocTypesAsCertain: false
+	bootstrapFiles:
+		- bootstrap.php
+	paths:
+		- TestCase/
+	earlyTerminatingMethodCalls:
+		Cake\Console\Shell:
+			- abort