Skip to content

Commit e7bb762

Browse files
Merge branch '6.4' into 7.0
* 6.4: move adding detailed JSON error messages to the validate phase [HttpFoundation] Add tests for `MethodRequestMatcher` and `SchemeRequestMatcher`
2 parents 325cea6 + 117f1f2 commit e7bb762

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Tests/RequestMatcher/MethodRequestMatcherTest.php

+7
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 [

Tests/RequestMatcher/SchemeRequestMatcherTest.php

+7
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)