diff --git a/src/Actions/SearchRequestAction.php b/src/Actions/SearchRequestAction.php index b021b70..7db7dc7 100644 --- a/src/Actions/SearchRequestAction.php +++ b/src/Actions/SearchRequestAction.php @@ -82,8 +82,8 @@ private function searchForMatchingExpectation(ServerRequestInterface $request): private function getNextMatchingExpectation(?Expectation $lastFound, ServerRequestInterface $request, Expectation $expectation): ?Expectation { - if ($this->comparator->equals($request, $expectation)) { - if (null === $lastFound || $expectation->getPriority() > $lastFound->getPriority()) { + if (null === $lastFound || $expectation->getPriority() > $lastFound->getPriority()) { + if ($this->comparator->equals($request, $expectation)) { $lastFound = $expectation; } }