10000 [Form] Replace broken ServerParams mock by derrabus · Pull Request #41238 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Replace broken ServerParams mock #41238

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
May 16, 2021

Conversation

derrabus
Copy link
Member
Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

AbstractRequestHandlerTest creates a mocked version of the ServerParams class. Since getNormalizedIniPostMaxSize() does not have a return type declaration, PHPUnit will by default create an implementation that always returns null. However, the real implementation of that method guarantees to always return a string.

This becomes problematic in PHP 8.1 because the return value is sometimes passed as-is into functions like strtolower() which trigger a deprecation warning on null now.

This PR proposes to replace the mock with a dummy implementation that returns an empty string by default.

@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas merged commit d3ebc5f into symfony:4.4 May 16, 2021
@derrabus derrabus deleted the bugfix/server-params-mock branch May 16, 2021 09:11
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.

3 participants
0