8000 [BrowserKit] BC-break since Client has been renamed to Browser · Issue #31039 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[BrowserKit] BC-break since Client has been renamed to Browser #31039

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
Devristo opened this issue Apr 9, 2019 · 4 comments
Closed

[BrowserKit] BC-break since Client has been renamed to Browser #31039

Devristo opened this issue Apr 9, 2019 · 4 comments

Comments

@Devristo
Copy link
Contributor
Devristo commented Apr 9, 2019

Symfony version(s) affected: 4.3.x-dev

Description
Since #30541 the inheritance hierarchy of \Symfony\Component\BrowserKit\Client has changed. Notably the test.client no longer is an instance of \Symfony\Component\BrowserKit\Client.

This breaks breaks at least https://github.com/FriendsOfBehat/SymfonyExtension and https://github.com/minkphp/MinkBrowserKitDriver and most probably other bundles using test.client.

How to reproduce

On Symfony 4.2 the following test case succeeds, on the master (4.3) branch this fails:

class TestClientTest extends \Symfony\Bundle\FrameworkBundle\Test\WebTestCase {
    public function testIsAClient()
    {
        $browser = static::createClient();
        $this->assertInstanceOf(\Symfony\Component\BrowserKit\Client::class, $browser);
    }
}

Possible Solution
Use a class_alias solution as described in #30541.

@nicolas-grekas
Copy link
Member

Deprecating the test.client service in favor of test.browser might work also
PR welcome

@stof
Copy link
Member
stof commented Apr 10, 2019

Well, deprecating the service will not solve the BC break, where the different Client BC classes are not child of each other anymore.

@Devristo
Copy link
Contributor Author

@stof see the discussion in #31040. We have concluded the same and came with a different approach.

@stof
Copy link
Member
stof commented Apr 10, 2019

yeah, I saw it after commenting here.

@fabpot fabpot closed this as completed Apr 15, 2019
fabpot added a commit that referenced this issue Apr 15, 2019
… to Browser (Devristo)

This PR was squashed before being merged into the 4.3-dev branch (closes #31040).

Discussion
----------

[BrowserKit] Fixed BC-break introduced by rename of Client to Browser

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

Since #30541 the inheritance hierarchy of `\Symfony\Component\BrowserKit\Client` has changed. Notably the test.client no longer is an instance of `\Symfony\Component\BrowserKit\Client`.

This PR uses `class_alias` to fix the class hierarchy similarly as has been done in Twig. In this case I copied the approach of `Twig_TokenParser_AutoEscape` and `\Twig\TokenParser\AutoEscapeTokenParser`

Commits
-------

6a94dea [BrowserKit] Fixed BC-break introduced by rename of Client to Browser
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

5 participants
0