protected function validateRequestOrThrowException(Expectation $expectation, LoggerInterface $logger) { if ($this->requestIsInvalid($expectation->getRequest())) { $logger->error('Invalid request specified in expectation'); throw new \RuntimeException('Invalid request specified in expectation'); } }
private function requestBodyOrUrlAreRegexp(Expectation $expectation) { return $expectation->getRequest()->getBody() && $expectation->getRequest()->getBody()->getMatcher() == Matchers::MATCHES || $expectation->getRequest()->getUrl() && $expectation->getRequest()->getUrl()->getMatcher() == Matchers::MATCHES; }