@@ -25,8 +25,8 @@ |
||
| 25 | 25 | protected function doValidation(Response $response) |
| 26 | 26 | { |
| 27 | 27 | foreach ($this->regExs as $regEx) { |
| 28 | - $this->assert(preg_match('^' . $regEx . '^', (string) $response->getBody()) > 0, |
|
| 29 | - 'The given regular expression (' . $regEx . ') was not found in this document.'); |
|
| 28 | + $this->assert(preg_match('^'.$regEx.'^', (string) $response->getBody()) > 0, |
|
| 29 | + 'The given regular expression ('.$regEx.') was not found in this document.'); |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -31,15 +31,15 @@ |
||
| 31 | 31 | |
| 32 | 32 | if ($xpath['relation'] = 'equals') { |
| 33 | 33 | $result = $count === $xpath['value']; |
| 34 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were exact ' . $xpath['value'] . ' occurencies.'; |
|
| 34 | + $message = 'The xpath "'.$xpath['pattern'].'" was found '.$count.' times. Expected were exact '.$xpath['value'].' occurencies.'; |
|
| 35 | 35 | } elseif ($xpath['relation'] === 'less than') { |
| 36 | 36 | $result = $count < $xpath['value']; |
| 37 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were less than ' . $xpath['value'] . '.'; |
|
| 37 | + $message = 'The xpath "'.$xpath['pattern'].'" was found '.$count.' times. Expected were less than '.$xpath['value'].'.'; |
|
| 38 | 38 | } elseif ($xpath['relation'] === 'greater than') { |
| 39 | 39 | $result = $count > $xpath['value']; |
| 40 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were more than ' . $xpath['value'] . '.'; |
|
| 40 | + $message = 'The xpath "'.$xpath['pattern'].'" was found '.$count.' times. Expected were more than '.$xpath['value'].'.'; |
|
| 41 | 41 | } else { |
| 42 | - throw new \RuntimeException('Relation not defined. Given "' . $xpath['relation'] . '" expected [equals, greater than, less than]'); |
|
| 42 | + throw new \RuntimeException('Relation not defined. Given "'.$xpath['relation'].'" expected [equals, greater than, less than]'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $this->assert($result, $message); |
@@ -26,10 +26,10 @@ |
||
| 26 | 26 | $validTo = date('d.m.Y H:i:s', $certInfo['validTo_time_t']); |
| 27 | 27 | |
| 28 | 28 | if ($certInfo['validFrom_time_t'] > time() || $certInfo['validTo_time_t'] < time()) { |
| 29 | - $errorMessage = 'Certificate is expired. [' . $validFrom . ' - ' . $validTo . ']'; |
|
| 29 | + $errorMessage = 'Certificate is expired. ['.$validFrom.' - '.$validTo.']'; |
|
| 30 | 30 | throw new ValidationFailedException($errorMessage); |
| 31 | - } elseif ($certInfo['validTo_time_t'] < strtotime('+' . $this->expireWarningTime . 'days')) { |
|
| 32 | - $errorMessage = 'Certificate warning, expires in less than ' . $this->expireWarningTime . ' days. Certificate expires at: ' . $validTo; |
|
| 31 | + } elseif ($certInfo['validTo_time_t'] < strtotime('+'.$this->expireWarningTime.'days')) { |
|
| 32 | + $errorMessage = 'Certificate warning, expires in less than '.$this->expireWarningTime.' days. Certificate expires at: '.$validTo; |
|
| 33 | 33 | throw new ValidationFailedException($errorMessage); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $sslOptions = stream_context_create(array('ssl' => array('capture_peer_cert' => true))); |
| 30 | 30 | |
| 31 | 31 | $request = stream_socket_client( |
| 32 | - 'ssl://' . $host . ':443', |
|
| 32 | + 'ssl://'.$host.':443', |
|
| 33 | 33 | $errno, |
| 34 | 34 | $errstr, |
| 35 | 35 | 30, |
@@ -23,10 +23,10 @@ |
||
| 23 | 23 | { |
| 24 | 24 | if (array_key_exists('issuer', $certInfo) and array_key_exists('CN', $certInfo['issuer'])) { |
| 25 | 25 | if ($certInfo['issuer']['CN'] != $this->authorityName) { |
| 26 | - throw new ValidationFailedException('Expected authority was "' . $this->authorityName . '", "' . $certInfo['issuer']['CN'] . '" found.'); |
|
| 26 | + throw new ValidationFailedException('Expected authority was "'.$this->authorityName.'", "'.$certInfo['issuer']['CN'].'" found.'); |
|
| 27 | 27 | } |
| 28 | 28 | } else { |
| 29 | - throw new ValidationFailedException('Expected authority was "' . $this->authorityName . '". No authority found.'); |
|
| 29 | + throw new ValidationFailedException('Expected authority was "'.$this->authorityName.'". No authority found.'); |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | protected function doValidation(Response $response) |
| 26 | 26 | { |
| 27 | 27 | foreach ($this->regExs as $regEx) { |
| 28 | - $this->assert(preg_match('^' . $regEx . '^', (string) $response->getBody()) === 0, |
|
| 29 | - 'The given regular expression (' . $regEx . ') was found in this document.'); |
|
| 28 | + $this->assert(preg_match('^'.$regEx.'^', (string) $response->getBody()) === 0, |
|
| 29 | + 'The given regular expression ('.$regEx.') was found in this document.'); |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public function finish() |
| 94 | 94 | { |
| 95 | - $this->output->writeln('Sending results to ' . $this->server . " ... \n"); |
|
| 95 | + $this->output->writeln('Sending results to '.$this->server." ... \n"); |
|
| 96 | 96 | |
| 97 | 97 | if ($this->groupBy === 'prefix') { |
| 98 | 98 | $this->sendGroupedByPrefix(); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | foreach ($this->getRuleKeys() as $rule) { |
| 125 | 125 | foreach ($systems as $system) { |
| 126 | - $identifier = $this->tool . '_' . $this->getPrefix($rule) . '_' . $system; |
|
| 126 | + $identifier = $this->tool.'_'.$this->getPrefix($rule).'_'.$system; |
|
| 127 | 127 | $failureMessages[$identifier]['message'] = ''; |
| 128 | 128 | $failureMessages[$identifier]['system'] = $system; |
| 129 | 129 | $failureMessages[$identifier]['tool'] = $this->getPrefix($rule); |
@@ -140,22 +140,22 @@ discard block |
||
| 140 | 140 | $system = $this->retriever->getSystem(($result->getUrl())); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - $identifer = $this->tool . '_' . $this->getPrefix($ruleLKey) . '_' . $system; |
|
| 143 | + $identifer = $this->tool.'_'.$this->getPrefix($ruleLKey).'_'.$system; |
|
| 144 | 144 | |
| 145 | 145 | if ($failureMessages[$identifer]['message'] === '') { |
| 146 | - $failureMessages[$identifer]['message'] = 'The ' . $this->getPrefix($ruleLKey) . ' test for #system_name# failed.<ul>'; |
|
| 146 | + $failureMessages[$identifer]['message'] = 'The '.$this->getPrefix($ruleLKey).' test for #system_name# failed.<ul>'; |
|
| 147 | 147 | } |
| 148 | 148 | ++$counter[$identifer]; |
| 149 | - $failureMessages[$identifer]['message'] .= '<li>' . $message . '<br>url: ' . $result->getUrl() . ', coming from: ' . $this->retriever->getComingFrom($result->getUrl()) . '</li>'; |
|
| 149 | + $failureMessages[$identifer]['message'] .= '<li>'.$message.'<br>url: '.$result->getUrl().', coming from: '.$this->retriever->getComingFrom($result->getUrl()).'</li>'; |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | foreach ($failureMessages as $key => $failureMessage) { |
| 155 | 155 | if ($failureMessage['message'] !== '') { |
| 156 | - $this->send($this->identifier . '_' . $key, $failureMessage['system'], $failureMessage['message'] . '</ul>', self::STATUS_FAILURE, '', $counter[$key], $failureMessage['tool']); |
|
| 156 | + $this->send($this->identifier.'_'.$key, $failureMessage['system'], $failureMessage['message'].'</ul>', self::STATUS_FAILURE, '', $counter[$key], $failureMessage['tool']); |
|
| 157 | 157 | } else { |
| 158 | - $this->send($this->identifier . '_' . $key, $failureMessage['system'], '', self::STATUS_SUCCESS, '', 0, $failureMessage['tool']); |
|
| 158 | + $this->send($this->identifier.'_'.$key, $failureMessage['system'], '', self::STATUS_SUCCESS, '', 0, $failureMessage['tool']); |
|
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $failedTests = array(); |
| 168 | 168 | if ($result->isFailure()) { |
| 169 | 169 | foreach ($result->getMessages() as $ruleLKey => $message) { |
| 170 | - $identifier = 'smoke_' . $ruleLKey . '_' . $result->getUrl(); |
|
| 170 | + $identifier = 'smoke_'.$ruleLKey.'_'.$result->getUrl(); |
|
| 171 | 171 | |
| 172 | 172 | if ($this->system === '') { |
| 173 | 173 | $system = str_replace('http://', '', $result->getUrl()); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | foreach ($rules as $rule) { |
| 182 | 182 | if (!in_array($rule, $failedTests, true)) { |
| 183 | - $identifier = 'smoke_' . $rule . '_' . $result->getUrl(); |
|
| 183 | + $identifier = 'smoke_'.$rule.'_'.$result->getUrl(); |
|
| 184 | 184 | |
| 185 | 185 | if ($this->systemUseRetriever) { |
| 186 | 186 | $system = $this->retriever->getSystem($result->getUrl()); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } else { |
| 190 | 190 | $system = $this->system; |
| 191 | 191 | } |
| 192 | - $this->send($identifier, $system, 'smoke_' . $rule . '_' . $result->getUrl(), self::STATUS_SUCCESS, (string) $result->getUrl()); |
|
| 192 | + $this->send($identifier, $system, 'smoke_'.$rule.'_'.$result->getUrl(), self::STATUS_SUCCESS, (string) $result->getUrl()); |
|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | } |
@@ -213,16 +213,16 @@ discard block |
||
| 213 | 213 | $system = $this->retriever->getSystem(new Uri($result->getUrl())); |
| 214 | 214 | } |
| 215 | 215 | if ($failureMessages[$ruleLKey] === '') { |
| 216 | - $failureMessages[$ruleLKey]['message'] = ' The smoke test for #system_name# failed (Rule: ' . $ruleLKey . ').<ul>'; |
|
| 216 | + $failureMessages[$ruleLKey]['message'] = ' The smoke test for #system_name# failed (Rule: '.$ruleLKey.').<ul>'; |
|
| 217 | 217 | } |
| 218 | 218 | ++$counter[$ruleLKey]; |
| 219 | 219 | |
| 220 | 220 | $comingFrom = ''; |
| 221 | 221 | if ($this->retriever->getComingFrom($result->getUrl())) { |
| 222 | - $comingFrom = ', coming from: ' . $this->retriever->getComingFrom($result->getUrl()); |
|
| 222 | + $comingFrom = ', coming from: '.$this->retriever->getComingFrom($result->getUrl()); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - $failureMessages[$ruleLKey]['message'] .= '<li>' . $message . ' (url: ' . $result->getUrl() . $comingFrom . ')</li > '; |
|
| 225 | + $failureMessages[$ruleLKey]['message'] .= '<li>'.$message.' (url: '.$result->getUrl().$comingFrom.')</li > '; |
|
| 226 | 226 | $failureMessages[$ruleLKey]['system'] = $system; |
| 227 | 227 | } |
| 228 | 228 | } |
@@ -230,9 +230,9 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | foreach ($failureMessages as $key => $failureMessage) { |
| 232 | 232 | if ($failureMessage !== '') { |
| 233 | - $this->send($this->identifier . '_' . $key, $this->system, $failureMessage['message'] . ' </ul > ', self::STATUS_FAILURE, '', $counter[$key]); |
|
| 233 | + $this->send($this->identifier.'_'.$key, $this->system, $failureMessage['message'].' </ul > ', self::STATUS_FAILURE, '', $counter[$key]); |
|
| 234 | 234 | } else { |
| 235 | - $this->send($this->identifier . '_' . $key, $this->system, '', self::STATUS_SUCCESS, '', 0); |
|
| 235 | + $this->send($this->identifier.'_'.$key, $this->system, '', self::STATUS_SUCCESS, '', 0); |
|
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | } |
@@ -24,13 +24,13 @@ |
||
| 24 | 24 | |
| 25 | 25 | foreach ($this->checkedHeaders as $headerConfig) { |
| 26 | 26 | if (!$response->hasHeader($headerConfig['key'])) { |
| 27 | - throw new ValidationFailedException('Header not found (' . $headerConfig['key'] . ')'); |
|
| 27 | + throw new ValidationFailedException('Header not found ('.$headerConfig['key'].')'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $currentValue = $response->getHeader($headerConfig['key'])[0]; |
| 31 | 31 | |
| 32 | - if (!preg_match('^' . $headerConfig['value'] . '^', $currentValue, $matches)) { |
|
| 33 | - throw new ValidationFailedException('Header "' . $headerConfig['key'] . '" does not match "' . $headerConfig['value'] . '". Current value is "' . $currentValue . '"'); |
|
| 32 | + if (!preg_match('^'.$headerConfig['value'].'^', $currentValue, $matches)) { |
|
| 33 | + throw new ValidationFailedException('Header "'.$headerConfig['key'].'" does not match "'.$headerConfig['value'].'". Current value is "'.$currentValue.'"'); |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -13,12 +13,12 @@ |
||
| 13 | 13 | public function doValidation(Response $response) |
| 14 | 14 | { |
| 15 | 15 | $domDocument = new \DOMDocument(); |
| 16 | - $success = @$domDocument->loadXML((string) $response->getBody()); // true/false |
|
| 16 | + $success = @$domDocument->loadXML((string) $response->getBody()); // true/false |
|
| 17 | 17 | |
| 18 | 18 | $lastError = libxml_get_last_error(); |
| 19 | 19 | if (!$success || $lastError) { |
| 20 | - throw new \RuntimeException('The xml file '. $response->getUri() . ' is not well formed (last error: ' . |
|
| 21 | - str_replace("\n", '', $lastError->message) . ').'); |
|
| 20 | + throw new \RuntimeException('The xml file '.$response->getUri().' is not well formed (last error: '. |
|
| 21 | + str_replace("\n", '', $lastError->message).').'); |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | } |