8000 minor #57732 [HttpFoundation] Add tests for `MethodRequestMatcher` an… · symfony/symfony@6fe0729 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fe0729

Browse files
minor #57732 [HttpFoundation] Add tests for MethodRequestMatcher and SchemeRequestMatcher (alexandre-daubois)
This PR was merged into the 6.4 branch. Discussion ---------- [HttpFoundation] Add tests for `MethodRequestMatcher` and `SchemeRequestMatcher` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Following #57714 after rebasing on 5.4 Commits ------- 5a3c2a6 [HttpFoundation] Add tests for `MethodRequestMatcher` and `SchemeRequestMatcher`
2 parents d628b75 + 5a3c2a6 commit 6fe0729

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/MethodRequestMatcherTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ public function test(string $requestMethod, array|string $matcherMethod, bool $i
2727
$this->assertSame($isMatch, $matcher->matches($request));
2828
}
2929

30+
public function testAlwaysMatchesOnEmptyMethod()
31+
{
32+
$matcher = new MethodRequestMatcher([]);
33+
$request = Request::create('https://example.com', 'POST');
34+
$this->assertTrue($matcher->matches($request));
35+
}
36+
3037
public static function getData()
3138
{
3239
return [
< A963 h3 id="heading-:R5mlab:" class="DiffFileHeader-module__file-name--mY1O5">src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/SchemeRequestMatcherTest.php
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ public function test(string $requestScheme, array|string $matcherScheme, bool $i
4242
}
4343
}
4444

45+
public function testAlwaysMatchesOnParamsHeaders()
46+
{
47+
$matcher = new SchemeRequestMatcher([]);
48+
$request = Request::create('sftp://example.com');
49+
$this->assertTrue($matcher->matches($request));
50+
}
51+
4552
public static function getData()
4653
{
4754
return [

0 commit comments

Comments
 (0)
0