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);
 }
Esempio n. 2
0
 public function testMergeMethodFailuresWithIncompatibleMatchResults()
 {
     $this->setExpectedException(DomainException::class, 'Both match results must be method failures');
     MatchResult::mergeMethodFailures(MatchResult::fromMatchFailure(), MatchResult::fromMatchFailure());
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  *
  * @throws UnexpectedValueException
  */
 public function match(ServerRequestInterface $request)
 {
     $basePathLength = strlen($this->baseUri['path']);
     return RouteCollectionMatcher::matchRouteCollection($this->routeCollection, $request, $basePathLength, []) ?: MatchResult::fromMatchFailure();
 }