Skip to content

Regression in FrameworkBundle's client when using custom container base class #27494

Closed
@pamil

Description

@pamil

Symfony version(s) affected: 4.1.0

Description
Service test.service_container does not respect the output of kernel's getContainerBaseClass method.

Therefore, when FrameworkBundle's Client returns it on getContainer, we receive an instance of TestContainer instead of SomeCustomContainer. This makes it impossible to call a custom method added to the container (in our case - https://github.com/PolishSymfonyCommunity/SymfonyMockerContainer).

How to reproduce
Either:

  • Define custom container base class and call a method on custom container coming from FrameworkBundle's Client.
  • Install Sylius v1.2.0-BETA and try to run phpunit tests.

Possible solution
Adding a __call method on TestContainer which passes unknown calls to TestContainer's public container.

Additional context
I'm up to making a PR fixing it (using the solution proposed above), but not before Wednesday, and I don't mind anyone fixing it before that :)

screen shot 2018-06-04 at 18 34 08

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