Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function doValidation(Response $response) |
||
23 | { |
||
24 | $domDocument = new \DOMDocument(); |
||
25 | @$domDocument->loadHTML((string) $response->getBody()); |
||
|
|||
26 | |||
27 | $domXPath = new \DOMXPath($domDocument); |
||
28 | |||
29 | foreach ($this->xPaths as $xpath) { |
||
30 | $this->assert($domXPath->query($xpath)->length > 0, 'The xpath ' . $xpath . ' was not found.'); |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 |
If you suppress an error, we recommend checking for the error condition explicitly: