Skip to content

False positive in Tests: Service XY is private #27

@Pierstoval

Description

@Pierstoval

When using the KernelTestCase and asking PhpStan to analyze a test, I have this error:

image

However, the static::$container that is in the KernelTestCase is supposed to be an instance of the TestContainer but is typed as ContainerInterface because it might happen that the test.container service can be absent from the container, therefore making static::$container be the full container (as of KernelTestCase here )

Here is the code that triggers the error: Pierstoval/AgateApps/.../RedeemerTest.php#L61-L79

If the test.container service exists in the container AND for this specific case, I think there shouldn't be any error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions