| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function doValidation(Response $response) |
||
| 22 | { |
||
| 23 | foreach ($this->checkedHeaders as $headerConfig) { |
||
| 24 | if (!$response->hasHeader($headerConfig['key'])) { |
||
| 25 | throw new ValidationFailedException('Header not found (' . $headerConfig['key'] . ')'); |
||
| 26 | } |
||
| 27 | |||
| 28 | $currentValue = $response->getHeader($headerConfig['key'])[0]; |
||
| 29 | |||
| 30 | if ($currentValue != $headerConfig['value']) { |
||
| 31 | throw new ValidationFailedException('Header "' . $headerConfig['key'] . '" does not equal "' . $headerConfig['value'] . '". Current value is "' . $currentValue . '"'); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 |