Skip to content

Commit 6c12c2d

Browse files
authored
test(github): Switch Drupal 9 testing to 9.1.x (#1126)
1 parent 47bd0dd commit 6c12c2d

2 files changed

Lines changed: 46 additions & 41 deletions

File tree

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
php-versions: ['7.3', '7.4']
25-
drupal-core: ['9.0.x']
25+
drupal-core: ['9.1.x']
2626
# Extra run to also test on latest Drupal 8 and PHP 7.2.
2727
include:
2828
- php-versions: '7.2'

phpstan.neon

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
11
includes:
2-
- ../../vendor/phpstan/phpstan-deprecation-rules/rules.neon
3-
- ../../vendor/mglaman/phpstan-drupal/extension.neon
4-
- ../../vendor/jangregor/phpstan-prophecy/extension.neon
5-
- ../../vendor/phpstan/phpstan-phpunit/extension.neon
2+
- ../../vendor/phpstan/phpstan-deprecation-rules/rules.neon
3+
- ../../vendor/mglaman/phpstan-drupal/extension.neon
4+
- ../../vendor/jangregor/phpstan-prophecy/extension.neon
5+
- ../../vendor/phpstan/phpstan-phpunit/extension.neon
66

77
parameters:
8-
# PHPStan cannot find files in this test directory automatically.
9-
scanDirectories:
10-
- ../../core/tests/Drupal/Tests
11-
level: 5
12-
customRulesetUsed: true
13-
paths:
14-
- .
15-
# We test with PHPStan on Drupal 8 and 9 and might have different ignored
16-
# errors on both.
17-
reportUnmatchedIgnoredErrors: false
18-
ignoreErrors:
19-
# @todo Ignore phpstan-drupal extension's rules for now, activate later.
20-
- '#\Drupal calls should be avoided in classes, use dependency injection instead#'
21-
# new static() is a best practice in Drupal, so we cannot fix that.
22-
- "#^Unsafe usage of new static\\(\\)\\.$#"
23-
# Drupal allows object property access to custom fields, so we cannot fix
24-
# that.
25-
- "#^Access to an undefined property Drupal\\\\#"
26-
# PHPUnit deprecation warnings in Drupal 9 that we don't care about.
27-
- "#^Call to deprecated method setMethods\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder:#"
28-
# Symfony 4 deprecations in Drupal 9 that we don't care about.
29-
- "#deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event#"
30-
- "#deprecated class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent#"
31-
- "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#"
32-
- "#deprecated interface Symfony\\\\Component\\\\HttpFoundation\\\\File\\\\MimeType\\\\MimeTypeGuesserInterface#"
33-
- "#^Parameter .+ of class Symfony\\\\Component\\\\HttpFoundation\\\\File\\\\UploadedFile constructor expects .+ given\\.$#"
34-
- "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
35-
# Drupal allows object property access to custom fields, so we cannot fix
36-
# that.
37-
- "#^Property Drupal\\\\.+ \\(Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\) does not accept .+\\.$#"
38-
# Incomplete type doc comments in Drupal core that we have to ignore.
39-
-
40-
message: "#^Method Drupal\\\\graphql\\\\Plugin\\\\LanguageNegotiation\\\\OperationLanguageNegotiation\\:\\:getLangcode\\(\\) should return string but returns false\\.$#"
41-
count: 1
42-
path: src/Plugin/LanguageNegotiation/OperationLanguageNegotiation.php
43-
- "#^Parameter .+ of method Drupal\\\\Core\\\\Entity\\\\Query\\\\QueryInterface\\:\\:range\\(\\) expects null, int given\\.$#"
8+
# PHPStan cannot find files in this test directory automatically.
9+
scanDirectories:
10+
- ../../core/tests/Drupal/Tests
11+
level: 5
12+
customRulesetUsed: true
13+
paths:
14+
- .
15+
# We test with PHPStan on Drupal 8 and 9 and might have different ignored
16+
# errors on both.
17+
reportUnmatchedIgnoredErrors: false
18+
ignoreErrors:
19+
# @todo Ignore phpstan-drupal extension's rules for now, activate later.
20+
- '#\Drupal calls should be avoided in classes, use dependency injection instead#'
21+
# new static() is a best practice in Drupal, so we cannot fix that.
22+
- "#^Unsafe usage of new static\\(\\)\\.$#"
23+
# Drupal allows object property access to custom fields, so we cannot fix
24+
# that.
25+
- "#^Access to an undefined property Drupal\\\\#"
26+
# PHPUnit deprecation warnings in Drupal 9 that we don't care about.
27+
- "#^Call to deprecated method setMethods\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder:#"
28+
# Other deprecations in Drupal 9 that we can't change because we want to
29+
# support Drupal 8.
30+
- "#deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event#"
31+
- "#deprecated class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent#"
32+
- "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#"
33+
- "#deprecated interface Symfony\\\\Component\\\\HttpFoundation\\\\File\\\\MimeType\\\\MimeTypeGuesserInterface#"
34+
- "#^Parameter .+ of class Symfony\\\\Component\\\\HttpFoundation\\\\File\\\\UploadedFile constructor expects .+ given\\.$#"
35+
- "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
36+
- """
37+
#^Call to deprecated method toInt\\(\\) of class Drupal\\\\Component\\\\Utility\\\\Bytes\\:
38+
in drupal\\:9\\.1\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\\\Component\\\\Utility\\\\Bytes\\:\\:toNumber\\(\\) instead$#
39+
"""
40+
# Drupal allows object property access to custom fields, so we cannot fix
41+
# that.
42+
- "#^Property Drupal\\\\.+ \\(Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\) does not accept .+\\.$#"
43+
# Incomplete type doc comments in Drupal core that we have to ignore.
44+
-
45+
message: "#^Method Drupal\\\\graphql\\\\Plugin\\\\LanguageNegotiation\\\\OperationLanguageNegotiation\\:\\:getLangcode\\(\\) should return string but returns false\\.$#"
46+
count: 1
47+
path: src/Plugin/LanguageNegotiation/OperationLanguageNegotiation.php
48+
- "#^Parameter .+ of method Drupal\\\\Core\\\\Entity\\\\Query\\\\QueryInterface\\:\\:range\\(\\) expects null, int given\\.$#"

0 commit comments

Comments
 (0)