From ceeded4323ddf44d4f5ace0fcc684456aa9a8ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=BDurek?= Date: Sun, 8 Dec 2019 23:28:32 +0100 Subject: [PATCH] run phpstan on tests --- .travis.yml | 2 +- phpstan.tests.neon | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 phpstan.tests.neon diff --git a/.travis.yml b/.travis.yml index 6a9722ddd0..5911d5a049 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,4 +81,4 @@ script: - if [[ $XMLLINT == "1" ]]; then diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml"); fi - if [[ $XMLLINT == "1" ]]; then diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml"); fi # Run PHPStan - - if [[ $PHPSTAN == "1" ]]; then composer require --dev phpstan/phpstan && php vendor/bin/phpstan analyse --configuration=phpstan.neon; fi + - if [[ $PHPSTAN == "1" ]]; then composer require --dev phpstan/phpstan phpstan/phpstan-phpunit && php vendor/bin/phpstan analyse --configuration=phpstan.neon && php vendor/bin/phpstan analyse --configuration=phpstan.tests.neon; fi diff --git a/phpstan.tests.neon b/phpstan.tests.neon new file mode 100644 index 0000000000..040f746490 --- /dev/null +++ b/phpstan.tests.neon @@ -0,0 +1,25 @@ +parameters: + level: 1 + paths: + - tests/Core + - tests/Standards + autoload_files: + - tests/bootstrap.php + ignoreErrors: + - + count: 1 + message: '~^Method PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest::getErrorList\(\) invoked with 1 parameter, 0 required\.$~' + path: /tests/Standards/AbstractSniffUnitTest.php + - + count: 1 + message: '~^Method PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest::getWarningList\(\) invoked with 1 parameter, 0 required\.$~' + path: /tests/Standards/AbstractSniffUnitTest.php + + dynamicConstantNames: + - PHP_CODESNIFFER_IN_TESTS + - PHP_CODESNIFFER_CBF + - PHP_CODESNIFFER_VERBOSITY + +includes: + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-phpunit/rules.neon