You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #57714 [HttpFoundation] Add tests for uncovered sections (alexandre-daubois)
This PR was merged into the 5.4 branch.
Discussion
----------
[HttpFoundation] Add tests for uncovered sections
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the latest branch.
- For new features, provide some code snippets to help understand usage.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
Commits
-------
d9fa800 [HttpFoundation] Add tests for uncovered sections
Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/InputBagTest.php
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -98,4 +98,22 @@ public function testFilterArrayWithoutArrayFlagIsDeprecated()
98
98
$this->expectDeprecation('Since symfony/http-foundation 5.1: Filtering an array value with "Symfony\Component\HttpFoundation\InputBag::filter()" without passing the FILTER_REQUIRE_ARRAY or FILTER_FORCE_ARRAY flag is deprecated');
99
99
$bag->filter('foo', \FILTER_VALIDATE_INT);
100
100
}
101
+
102
+
publicfunctiontestAdd()
103
+
{
104
+
$bag = newInputBag(['foo' => 'bar']);
105
+
$bag->add(['baz' => 'qux']);
106
+
107
+
$this->assertSame('bar', $bag->get('foo'), '->add() does not remove existing parameters');
108
+
$this->assertSame('qux', $bag->get('baz'), '->add() adds new parameters');
0 commit comments