Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run phpstan on tests #2755

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 25 additions & 0 deletions phpstan.tests.neon
Original file line number Diff line number Diff line change
@@ -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