Tighten ParameterBag classes in PHPUnit tests

Created on 16 March 2024, 8 months ago
Updated 31 March 2024, 8 months ago

Problem/Motivation

As discovered in πŸ“Œ Symfony 7 compatibility Active , see PHPUnit test results, we have a few occurrences in unit tests where we use Symfony\Component\HttpFoundation\ParameterBag where we can/should use the more specific bags Symfony\Component\HttpFoundation\InputBag and Symfony\Component\HttpFoundation\HeaderBag.

With the current Symfony 6.x this is all fine, but from Symfony 7.0 we get test-failures similar to

TypeError: Cannot assign Mock_ParameterBag_0d737a6f to property Symfony\Component\HttpFoundation\Request::$query of type Symfony\Component\HttpFoundation\InputBag

Steps to reproduce

Proposed resolution

We can already tighten the used classes and make the MR to jump to Symfony 7 a bit smaller.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.2 ✨

Component
BaseΒ  β†’

Last updated about 5 hours ago

Created by

πŸ‡³πŸ‡±Netherlands spokje

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024