@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | See https://github.com/zsturgess/overwatch/blob/master/app/Resources/docs/installing.md#cleaning-up-results |
| 53 | 53 | |
| 54 | -EOF |
|
| 54 | +eof |
|
| 55 | 55 | ) |
| 56 | 56 | ; |
| 57 | 57 | } |
@@ -232,9 +232,19 @@ |
||
| 232 | 232 | /** |
| 233 | 233 | * FOSUserBundle needs groups to have roles. We don't. |
| 234 | 234 | */ |
| 235 | - public function getRoles() { return []; } |
|
| 236 | - public function setRoles(array $roles) { return $this; } |
|
| 237 | - public function addRole($role) { return $this; } |
|
| 238 | - public function removeRole($role) { return $this; } |
|
| 239 | - public function hasRole($role) { return false; } |
|
| 235 | + public function getRoles() |
|
| 236 | + { |
|
| 237 | +return []; } |
|
| 238 | + public function setRoles(array $roles) |
|
| 239 | + { |
|
| 240 | +return $this; } |
|
| 241 | + public function addRole($role) |
|
| 242 | + { |
|
| 243 | +return $this; } |
|
| 244 | + public function removeRole($role) |
|
| 245 | + { |
|
| 246 | +return $this; } |
|
| 247 | + public function hasRole($role) |
|
| 248 | + { |
|
| 249 | +return false; } |
|
| 240 | 250 | } |
@@ -44,6 +44,6 @@ |
||
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - throw new Result\ExpectationFailedException("Expected $actual to resolve to $expected, actually resolves to $found"); |
|
| 47 | + throw new Result\ExpectationFailedException("expected $actual to resolve to $expected, actually resolves to $found"); |
|
| 48 | 48 | } |
| 49 | 49 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } catch (\Exception $e) { |
| 44 | 44 | //Transform exception under certain circumstances, else re-throw. |
| 45 | 45 | if ($e instanceof \GuzzleHttp\Exception\RequestException && !$e->hasResponse()) { |
| 46 | - throw new Result\ExpectationFailedException("Expected $actual to respond HTTP $expected, actually failed to respond", 0, $e); |
|
| 46 | + throw new Result\ExpectationFailedException("expected $actual to respond HTTP $expected, actually failed to respond", 0, $e); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | throw $e; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | if ($this->isValidStatusCode($expected)) { |
| 55 | 55 | if ((int) $expected !== $result) { |
| 56 | - throw new Result\ExpectationFailedException("Expected $actual to respond HTTP $expected, actually responded HTTP $result"); |
|
| 56 | + throw new Result\ExpectationFailedException("expected $actual to respond HTTP $expected, actually responded HTTP $result"); |
|
| 57 | 57 | } |
| 58 | 58 | } else { |
| 59 | 59 | if (in_array($result, $this->config["unsatisfactory_codes"])) { |
@@ -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) { |