Closed enduro44 closed 3 years ago
@mcustiel Check out phiremock-server/src/Utils/RequestExpectationComparator.php where Contains:matches is called. Http Body is passed as value (needle) and condition is set in constructor and used as haystack in strpos. Unit test should fail, I guess. And sorry I didn't write unit test myself to test this :(
private function requestBodyMatchesExpectation(ServerRequestInterface $httpRequest, Conditions $expectedRequest): bool
{
$bodycondition = $expectedRequest->getBody();
if (!$bodycondition) {
return true;
}
$this->logger->debug('Checking BODY against expectation');
return $bodycondition->getMatcher()->matches($httpRequest->getBody()->__toString());
}
`
Indeed it's broken. Nice catch. Thank you very much for your fix.
Hello @enduro44 I think this fix is not needed as this matcher works as expected. I will write a small unit test to verify it and will come back to you later. Thank you.