Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Symfony 4.3 "test.client" service is not an instance of Symfony\Bundle\FrameworkBundle\Client #31762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pamil opened this issue May 31, 2019 · 3 comments

Comments

@pamil
Copy link
Contributor

pamil commented May 31, 2019

Symfony version(s) affected: 4.3.0

Description

Prior to 4.3.0, test.client used to be an instance of Symfony\Bundle\FrameworkBundle\Client.
In 4.3.0, it becomes Symfony\Bundle\FrameworkBundle\KernelBrowser which does not extend Symfony\Bundle\FrameworkBundle\Client anymore.

Because of the lack of interfaces, there was no other possibility to typehint it than to use the class name.

I saw Symfony\Component\BrowserKit\Client has been deprecated but it's still used, is it possible to do the same with FrameworkBundle's Client?

@lyrixx
Copy link
Member

lyrixx commented Jun 5, 2019

And BTW, the return value of self::createClient(); has changed in the same way. I think this is a BC break too

@alexislefebvre
Copy link
Contributor

alexislefebvre commented Jun 5, 2019

This looks similar to #31653: value and type hint of the client property have changed.

@nicolas-grekas
Copy link
Member

See #31881

@fabpot fabpot closed this as completed Jun 6, 2019
fabpot added a commit that referenced this issue Jun 6, 2019
…icolas-grekas)

This PR was merged into the 4.3 branch.

Discussion
----------

[FramworkBundle][HttpKernel] fix KernelBrowser BC layer

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31762
| License       | MIT
| Doc PR        | -

Swap the order of inheritance to preserve BC with legacy `Client` type hints.
From #30541

Commits
-------

1a4c254 [FramworkBundle][HttpKernel] fix KernelBrowser BC layer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants