Closed
Description
Symfony version(s) affected
6.1
Description
Argument $expectedValue has a not-nullable type string. But the value property in class Symfony\Component\HttpFoundation\Cookie can be null.
How to reproduce
In any test that extends WebTestCase use the assertion:
self::assertResponseCookieValueSame('SOME_COOKIE_NAME', null);
Possible Solution
- In method Symfony\Bundle\FrameworkBundle\Test\BrowserKitAssertionsTrait::assertResponseCookieValueSame change type of argument $expectedValue to ?string
- In class Symfony\Component\HttpFoundation\Test\Constraint\ResponseCookieValueSame change type of private property $value to ?string
- In method Symfony\Component\HttpFoundation\Test\Constraint\ResponseCookieValueSame::_construct change type of argument $value to ?string
Additional Context
No response