Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  move adding detailed JSON error messages to the validate phase
  [HttpFoundation] Add tests for `MethodRequestMatcher` and `SchemeRequestMatcher`
  • Loading branch information
nicolas-grekas committed Jul 26, 2024
2 parents 325cea6 + 117f1f2 commit e7bb762
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Tests/RequestMatcher/MethodRequestMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ public function test(string $requestMethod, array|string $matcherMethod, bool $i
$this->assertSame($isMatch, $matcher->matches($request));
}

public function testAlwaysMatchesOnEmptyMethod()
{
$matcher = new MethodRequestMatcher([]);
$request = Request::create('https://example.com', 'POST');
$this->assertTrue($matcher->matches($request));
}

public static function getData()
{
return [
Expand Down
7 changes: 7 additions & 0 deletions Tests/RequestMatcher/SchemeRequestMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public function test(string $requestScheme, array|string $matcherScheme, bool $i
}
}

public function testAlwaysMatchesOnParamsHeaders()
{
$matcher = new SchemeRequestMatcher([]);
$request = Request::create('sftp://example.com');
$this->assertTrue($matcher->matches($request));
}

public static function getData()
{
return [
Expand Down

0 comments on commit e7bb762

Please sign in to comment.