| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function validate(Response $response, Result $result): void |
||
| 34 | { |
||
| 35 | $destination = $response->getDestination(); |
||
| 36 | if ($destination === null) { |
||
| 37 | throw new Exception('No destination set in the response.'); |
||
| 38 | } |
||
| 39 | if (!$this->expectedDestination->equals(new Destination($destination))) { |
||
| 40 | $result->addError(sprintf( |
||
| 41 | 'Destination in response "%s" does not match the expected destination "%s"', |
||
| 42 | $destination, |
||
| 43 | strval($this->expectedDestination), |
||
| 44 | )); |
||
| 48 |