Skip to content

Wrong argument type at method assertResponseCookieValueSame (Symfony\Bundle\FrameworkBundle\Test\BrowserKitAssertionsTrait class) #48105

Closed
@werwolf666

Description

@werwolf666

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

  1. In method Symfony\Bundle\FrameworkBundle\Test\BrowserKitAssertionsTrait::assertResponseCookieValueSame change type of argument $expectedValue to ?string
  2. In class Symfony\Component\HttpFoundation\Test\Constraint\ResponseCookieValueSame change type of private property $value to ?string
  3. In method Symfony\Component\HttpFoundation\Test\Constraint\ResponseCookieValueSame::_construct change type of argument $value to ?string

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions