Commit d3ebc5f
committed
minor #41238 [Form] Replace broken ServerParams mock (derrabus)
This PR was merged into the 4.4 branch.
Discussion
----------
[Form] Replace broken ServerParams mock
| 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.
Commits
-------
77c2d69 [Form] Replace broken ServerParams mockFile tree
1 file changed
+18
-8
lines changed- src/Symfony/Component/Form/Tests
1 file changed
+18
-8
lines changedLines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
48 | 62 | | |
49 | 63 | | |
50 | 64 | | |
| |||
310 | 324 | | |
311 | 325 | | |
312 | 326 | | |
313 | | - | |
| 327 | + | |
314 | 328 | | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 329 | + | |
| 330 | + | |
321 | 331 | | |
322 | 332 | | |
323 | 333 | | |
| |||
0 commit comments