@@ -12,7 +12,8 @@ discard block |
||
| 12 | 12 | * Expectation that takes a plain string or regular expression. If the document |
| 13 | 13 | * has a DOM, each element's textual content will be checked for |
| 14 | 14 | */ |
| 15 | -class ToContainTextExpectation implements ExpectationInterface { |
|
| 15 | +class ToContainTextExpectation implements ExpectationInterface |
|
| 16 | +{ |
|
| 16 | 17 | private $expectationConfig; |
| 17 | 18 | private $httpClient; |
| 18 | 19 | |
@@ -60,7 +61,8 @@ discard block |
||
| 60 | 61 | ); |
| 61 | 62 | } |
| 62 | 63 | |
| 63 | - private function crawlResponse($response, $needle) { |
|
| 64 | + private function crawlResponse($response, $needle) |
|
| 65 | + { |
|
| 64 | 66 | $crawler = new Crawler((string) $response); |
| 65 | 67 | |
| 66 | 68 | foreach ($crawler as $element) { |
@@ -72,7 +74,8 @@ discard block |
||
| 72 | 74 | return false; |
| 73 | 75 | } |
| 74 | 76 | |
| 75 | - private function findInString($haystack, $needle) { |
|
| 77 | + private function findInString($haystack, $needle) |
|
| 78 | + { |
|
| 76 | 79 | $result = @preg_match($needle, $haystack); |
| 77 | 80 | |
| 78 | 81 | if ($result === false) { |