Skip to content

Commit de2bb38

Browse files
committed
Broaden CI matrix to Symfony 7.4 LTS + 8.1 stable + 8.2 next; fix type-error response code
- composer.json: lift minimum symfony/* constraints from ^7.2 to ^7.4 || ^8.0 to reflect dropped support below 7.4 LTS and add 8.x compatibility - ci.yml: add Symfony 8.1 to stable phpunit/behat matrices; update phpunit-symfony-next and behat-symfony-next from 8.0 to 8.2, and pin extra.symfony.require so Composer actually resolves 8.2.x-dev packages; include symfony version in artifact names to avoid name conflicts - api_platform.yaml: map TypeError and NotNormalizableValueException to 422 so wrong-type input returns a structured error on all Symfony versions - page.feature: update incorrect-type scenario expectation from 500 to 422 now that AP4 consistently returns a structured error response
1 parent 47c3338 commit de2bb38

4 files changed

Lines changed: 41 additions & 34 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- '8.5'
5353
symfony:
5454
- '7.4'
55+
- '8.1'
5556
experimental:
5657
- false
5758
include:
@@ -111,14 +112,14 @@ jobs:
111112
if: always()
112113
uses: actions/upload-artifact@v4
113114
with:
114-
name: phpunit-logs-php${{ matrix.php }}
115+
name: phpunit-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
115116
path: build/logs/phpunit
116117
continue-on-error: true
117118
- name: Upload coverage results to Codecov
118119
if: matrix.coverage
119120
uses: codecov/codecov-action@v3
120121
with:
121-
name: phpunit-php${{ matrix.php }}
122+
name: phpunit-php${{ matrix.php }}-symfony${{ matrix.symfony }}
122123
flags: phpunit
123124
fail_ci_if_error: false
124125
token: ${{ secrets.CODECOV_TOKEN }}
@@ -150,6 +151,7 @@ jobs:
150151
- '8.5'
151152
symfony:
152153
- '7.4'
154+
- '8.1'
153155
experimental:
154156
- false
155157
include:
@@ -213,14 +215,14 @@ jobs:
213215
if: always()
214216
uses: actions/upload-artifact@v4
215217
with:
216-
name: behat-logs-php${{ matrix.php }}
218+
name: behat-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
217219
path: build/logs/behat
218220
continue-on-error: true
219221
- name: Upload coverage results to Codecov
220222
if: matrix.coverage
221223
uses: codecov/codecov-action@v3
222224
with:
223-
name: behat-php${{ matrix.php }}
225+
name: behat-php${{ matrix.php }}-symfony${{ matrix.symfony }}
224226
flags: behat
225227
fail_ci_if_error: false
226228
token: ${{ secrets.CODECOV_TOKEN }}
@@ -341,7 +343,7 @@ jobs:
341343
php:
342344
- '8.5'
343345
symfony:
344-
- '8.0'
346+
- '8.2'
345347
fail-fast: false
346348
timeout-minutes: 20
347349
steps:
@@ -374,7 +376,8 @@ jobs:
374376
continue-on-error: true
375377
- name: Update project dependencies
376378
run: |
377-
composer config minimum-stability dev
379+
composer config extra.symfony.require ${{ matrix.symfony }}
380+
composer config minimum-stability dev
378381
composer config prefer-stable false
379382
composer update --no-progress --ansi
380383
- name: Flag held back Symfony packages
@@ -413,7 +416,7 @@ jobs:
413416
php:
414417
- '8.5'
415418
symfony:
416-
- '8.0'
419+
- '8.2'
417420
fail-fast: false
418421
timeout-minutes: 20
419422
steps:
@@ -446,7 +449,8 @@ jobs:
446449
continue-on-error: true
447450
- name: Update project dependencies
448451
run: |
449-
composer config minimum-stability dev
452+
composer config extra.symfony.require ${{ matrix.symfony }}
453+
composer config minimum-stability dev
450454
composer config prefer-stable false
451455
composer update --no-progress --ansi
452456
- name: Clear test app cache

composer.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@
4040
"ramsey/collection": "^1.2",
4141
"ramsey/uuid": "^4.5",
4242
"ramsey/uuid-doctrine": "^2.1",
43-
"symfony/asset": "^7.2",
44-
"symfony/console": "^7.2",
45-
"symfony/doctrine-bridge": "^7.2",
46-
"symfony/event-dispatcher": "^7.2",
47-
"symfony/expression-language": "^7.2",
48-
"symfony/form": "^7.2",
49-
"symfony/framework-bundle": "^7.2",
50-
"symfony/mailer": "^7.4",
51-
"symfony/property-access": "^7.4",
52-
"symfony/property-info": "^7.4",
53-
"symfony/security-bundle": "^7.4",
54-
"symfony/serializer": "^7.4",
55-
"symfony/twig-bundle": "^7.4",
56-
"symfony/type-info": "^7.4",
57-
"symfony/validator": "^7.4",
58-
"symfony/var-exporter": "^8",
43+
"symfony/asset": "^7.4 || ^8.0",
44+
"symfony/console": "^7.4 || ^8.0",
45+
"symfony/doctrine-bridge": "^7.4 || ^8.0",
46+
"symfony/event-dispatcher": "^7.4 || ^8.0",
47+
"symfony/expression-language": "^7.4 || ^8.0",
48+
"symfony/form": "^7.4 || ^8.0",
49+
"symfony/framework-bundle": "^7.4 || ^8.0",
50+
"symfony/mailer": "^7.4 || ^8.0",
51+
"symfony/property-access": "^7.4 || ^8.0",
52+
"symfony/property-info": "^7.4 || ^8.0",
53+
"symfony/security-bundle": "^7.4 || ^8.0",
54+
"symfony/serializer": "^7.4 || ^8.0",
55+
"symfony/twig-bundle": "^7.4 || ^8.0",
56+
"symfony/type-info": "^7.4 || ^8.0",
57+
"symfony/validator": "^7.4 || ^8.0",
58+
"symfony/var-exporter": "^7.4 || ^8.0",
5959
"twig/cssinliner-extra": "^3.0.3",
6060
"twig/extra-bundle": "^3.0.3",
6161
"twig/inky-extra": "^3.0.3",
@@ -85,18 +85,18 @@
8585
"phpunit/phpunit": "^12.1",
8686
"rector/rector": "^0.18.6",
8787
"roave/security-advisories": "dev-master",
88-
"symfony/browser-kit": "^7.4",
89-
"symfony/css-selector": "^7.4",
90-
"symfony/dotenv": "^7.4",
91-
"symfony/http-client": "^7.4",
88+
"symfony/browser-kit": "^7.4 || ^8.0",
89+
"symfony/css-selector": "^7.4 || ^8.0",
90+
"symfony/dotenv": "^7.4 || ^8.0",
91+
"symfony/http-client": "^7.4 || ^8.0",
9292
"symfony/maker-bundle": "^1.0",
9393
"symfony/mercure": "^0.6.2",
9494
"symfony/mercure-bundle": "^0.3.5",
95-
"symfony/messenger": "^7.4",
95+
"symfony/messenger": "^7.4 || ^8.0",
9696
"symfony/monolog-bundle": "^3.8",
97-
"symfony/phpunit-bridge": "^7.3",
98-
"symfony/stopwatch": "^7.4",
99-
"symfony/web-profiler-bundle": "^7.4"
97+
"symfony/phpunit-bridge": "^7.4 || ^8.0",
98+
"symfony/stopwatch": "^7.4 || ^8.0",
99+
"symfony/web-profiler-bundle": "^7.4 || ^8.0"
100100
},
101101
"config": {
102102
"preferred-install": {
@@ -125,7 +125,7 @@
125125
"symfony": {
126126
"allow-contrib": false,
127127
"root-dir": "tests/Functional/app",
128-
"require": "^7.4"
128+
"require": "^7.4 || ^8.0"
129129
}
130130
},
131131
"scripts": {

features/main/page.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Feature: Page resources
110110
When I send a "POST" request to "/_/pages" with data:
111111
| layout | reference | isTemplate |
112112
| <layout> | <reference> | false |
113-
Then the response status code should be 500
113+
Then the response status code should be 422
114114
And the JSON should be valid according to the schema file "error.schema.json"
115115
And the JSON node "description" should be equal to the string '<message>'
116116
Examples:

tests/Functional/app/config/packages/api_platform.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ api_platform:
2828
# event listeners will always be available...
2929
# we do recommend using providers/processors instead
3030
use_symfony_listeners: true
31+
exception_to_status:
32+
Symfony\Component\Serializer\Exception\NotNormalizableValueException: 422
33+
TypeError: 422
3134
defaults:
3235
standard_put: true
3336
extra_properties:

0 commit comments

Comments
 (0)