Skip to content

[FrameworkBundle] Make the TestBrowserToken interchangeable with other tokens #40368

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

Merged
merged 1 commit into from
Mar 16, 2021

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Mar 5, 2021

Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

For some reason most tokens implement getFirewallName (and the deprecated getProviderKey), but not all. This adds it to TestBrowserToken because it caused issues in my tests when upgrading to Symfony 5's Client::loginUser().

I am also happy to add this to AnonymousToken but I am more worried about BC impacts there, so I left it alone for now. All other token classes implement it, so I am not sure why this isn't in TokenInterface to begin with.

@carsonbot carsonbot added this to the 5.2 milestone Mar 5, 2021
@Seldaek Seldaek changed the title [FrameworkBundle] Make the TestBrowserToken interchangeable with othe… [FrameworkBundle] Make the TestBrowserToken interchangeable with other tokens Mar 5, 2021
@wouterj wouterj self-requested a review March 5, 2021 10:24
@nicolas-grekas nicolas-grekas force-pushed the add_token_getfirewall branch from fdb5608 to a4958ae Compare March 16, 2021 08:58
@nicolas-grekas
Copy link
Member

Thank you @Seldaek.

@nicolas-grekas nicolas-grekas merged commit faf7269 into symfony:5.2 Mar 16, 2021
@Seldaek Seldaek deleted the add_token_getfirewall branch March 16, 2021 09:27
nicolas-grekas added a commit that referenced this pull request Mar 23, 2021
…s serialized (kbond)

This PR was merged into the 5.2 branch.

Discussion
----------

[FrameworkBundle] ensure TestBrowserToken::$firewallName is serialized

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Fixes a bug introduced in #40368. When `TestBrowserToken` in unserialized, `$firewallName` is `null` so trying to access it via `getFirewallName` throws a `TypeError`.

Commits
-------

8ba12ec [FrameworkBundle] ensure TestBrowserToken::$firewallName is serialized
@fabpot fabpot mentioned this pull request Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants