public function testUnknownMatchResultTakesPrecedence() { $expectedMatchResult = MatchResult::fromMatchFailure(); $matchResult = RouteCollectionMatcher::matchRouteCollection($this->buildRouteCollection([null, MatchResult::fromSchemeFailure($this->prophesize(UriInterface::class)->reveal()), MatchResult::fromMethodFailure([]), $expectedMatchResult, 'no-call']), $this->prophesize(ServerRequestInterface::class)->reveal(), 0, []); $this->assertSame($expectedMatchResult, $matchResult); }
public function testMergeMethodFailuresWithIncompatibleMatchResults() { $this->setExpectedException(DomainException::class, 'Both match results must be method failures'); MatchResult::mergeMethodFailures(MatchResult::fromMatchFailure(), MatchResult::fromMatchFailure()); }
/** * {@inheritdoc} * * @throws UnexpectedValueException */ public function match(ServerRequestInterface $request) { $basePathLength = strlen($this->baseUri['path']); return RouteCollectionMatcher::matchRouteCollection($this->routeCollection, $request, $basePathLength, []) ?: MatchResult::fromMatchFailure(); }