@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | $this->fs = new Filesystem(); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - $this->docDir = __DIR__ . '/../../../../app/Resources/docs/expectations'; |
|
| 24 | - $this->expectationDir = __DIR__ . '/../../Expectation'; |
|
| 23 | + $this->docDir = __DIR__.'/../../../../app/Resources/docs/expectations'; |
|
| 24 | + $this->expectationDir = __DIR__.'/../../Expectation'; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function testExpectationsDocumented() |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function testExpectationDocsLinked() |
| 36 | 36 | { |
| 37 | - $indexMd = file_get_contents($this->docDir . '/../index.md'); |
|
| 37 | + $indexMd = file_get_contents($this->docDir.'/../index.md'); |
|
| 38 | 38 | $expectations = explode("\n", strstr(strstr($indexMd, '##Getting test results', true), '##Expectations')); |
| 39 | 39 | $countExpectationsInIndex = 0; |
| 40 | 40 | |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | preg_match('/^- \[[A-Z]+\]\(expectations(\/[A-Z_]+\.md)\)/i', $expectation, $matches); |
| 48 | 48 | |
| 49 | 49 | $this->assertTrue(( |
| 50 | - file_exists(realpath($this->docDir . $matches[1])) && |
|
| 51 | - !is_dir(realpath($this->docDir . $matches[1])) |
|
| 50 | + file_exists(realpath($this->docDir.$matches[1])) && |
|
| 51 | + !is_dir(realpath($this->docDir.$matches[1])) |
|
| 52 | 52 | )); |
| 53 | 53 | |
| 54 | 54 | $countExpectationsInIndex++; |
@@ -36,13 +36,13 @@ |
||
| 36 | 36 | socket_close($socket); |
| 37 | 37 | |
| 38 | 38 | if ($rtt > $this->config['unsatisfactory']) { |
| 39 | - throw new Result\ExpectationUnsatisfactoryException("$actual responded in $rtt s, above the unsatisfactory threshold (" . $this->config['unsatisfactory'] . ' s)'); |
|
| 39 | + throw new Result\ExpectationUnsatisfactoryException("$actual responded in $rtt s, above the unsatisfactory threshold (".$this->config['unsatisfactory'].' s)'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - return 'Pinged in ' . $rtt . 's'; |
|
| 42 | + return 'Pinged in '.$rtt.'s'; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | socket_close($socket); |
| 46 | - throw new Result\ExpectationFailedException("$actual failed to respond in the timeout threshold (" . $this->config['timeout'] . ' s)'); |
|
| 46 | + throw new Result\ExpectationFailedException("$actual failed to respond in the timeout threshold (".$this->config['timeout'].' s)'); |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - return "Responded HTTP $result " . $response->getReasonPhrase(); |
|
| 66 | + return "Responded HTTP $result ".$response->getReasonPhrase(); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | private function isValidStatusCode($code) |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | if ($found === $expected) { |
| 43 | - return $actual . ' has a ' . $dnsRecord['type'] . ' record that resolves to ' . $found; |
|
| 43 | + return $actual.' has a '.$dnsRecord['type'].' record that resolves to '.$found; |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | try { |
| 36 | 36 | $reporter->notify($result); |
| 37 | 37 | } catch (\Exception $ex) { |
| 38 | - $this->logger->error('An error occurred whilst calling ResultReporter ' . \get_class($reporter) . ':' . $ex); |
|
| 38 | + $this->logger->error('An error occurred whilst calling ResultReporter '.\get_class($reporter).':'.$ex); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public static function isValid($status) |
| 29 | 29 | { |
| 30 | 30 | if (!in_array($status, self::getAll())) { |
| 31 | - throw new \InvalidArgumentException($status . ' is not a valid TestResult status'); |
|
| 31 | + throw new \InvalidArgumentException($status.' is not a valid TestResult status'); |
|
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public function testGetRecentGroupResults() |
| 38 | 38 | { |
| 39 | 39 | $this->logIn('ROLE_SUPER_ADMIN'); |
| 40 | - $this->client->request('GET', '/api/results/group/' . TestGroupFixtures::$groups['group-1']->getId()); |
|
| 40 | + $this->client->request('GET', '/api/results/group/'.TestGroupFixtures::$groups['group-1']->getId()); |
|
| 41 | 41 | |
| 42 | 42 | $this->assertJsonResponse($this->client->getResponse()); |
| 43 | 43 | $this->assertCount(2, $this->getResponseContent()); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | public function testGetRecentGroupResultsInsufficentPerms() |
| 49 | 49 | { |
| 50 | 50 | $this->logIn('ROLE_ADMIN'); |
| 51 | - $this->client->request('GET', '/api/results/group/' . TestGroupFixtures::$groups['group-1']->getId()); |
|
| 51 | + $this->client->request('GET', '/api/results/group/'.TestGroupFixtures::$groups['group-1']->getId()); |
|
| 52 | 52 | |
| 53 | 53 | $this->assertForbidden($this->client->getResponse()); |
| 54 | 54 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function testGetResultsForTest() |
| 57 | 57 | { |
| 58 | 58 | $this->logIn('ROLE_SUPER_ADMIN'); |
| 59 | - $this->client->request('GET', '/api/results/test/' . TestFixtures::$tests['test-1']->getId()); |
|
| 59 | + $this->client->request('GET', '/api/results/test/'.TestFixtures::$tests['test-1']->getId()); |
|
| 60 | 60 | |
| 61 | 61 | $this->assertJsonResponse($this->client->getResponse()); |
| 62 | 62 | $this->assertCount(3, $this->getResponseContent()); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | public function testGetResultsForTestInsufficentPerms() |
| 69 | 69 | { |
| 70 | 70 | $this->logIn('ROLE_ADMIN'); |
| 71 | - $this->client->request('GET', '/api/results/test/' . TestFixtures::$tests['test-1']->getId()); |
|
| 71 | + $this->client->request('GET', '/api/results/test/'.TestFixtures::$tests['test-1']->getId()); |
|
| 72 | 72 | |
| 73 | 73 | $this->assertForbidden($this->client->getResponse()); |
| 74 | 74 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $command = new ResultCleanupCommand(); |
| 35 | 35 | $command->setContainer($this->getContainer()); |
| 36 | 36 | |
| 37 | - $this->application = new Application('Overwatch', '0.0.1-test.' . time()); |
|
| 37 | + $this->application = new Application('Overwatch', '0.0.1-test.'.time()); |
|
| 38 | 38 | $this->application->add($command); |
| 39 | 39 | |
| 40 | 40 | $this->command = new CommandTester($command); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $delete = $this->convertOption($input->getOption('delete')); |
| 75 | 75 | $compress = $this->convertOption($input->getOption('compress')); |
| 76 | 76 | |
| 77 | - $this->output->writeln($this->getApplication()->getLongVersion() . ', running a cleanup'); |
|
| 77 | + $this->output->writeln($this->getApplication()->getLongVersion().', running a cleanup'); |
|
| 78 | 78 | |
| 79 | 79 | if ($delete === null && $compress === null) { |
| 80 | 80 | throw new \InvalidArgumentException('Neither the --delete or --compress options were passed. No operation will be completed.'); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->deleteResults($delete); |
| 88 | 88 | $this->compressResults($compress); |
| 89 | 89 | |
| 90 | - $output->writeln(' > Applying <info>' . count($this->em->getUnitOfWork()->getScheduledEntityDeletions()) . '</info> cleanup operations'); |
|
| 90 | + $output->writeln(' > Applying <info>'.count($this->em->getUnitOfWork()->getScheduledEntityDeletions()).'</info> cleanup operations'); |
|
| 91 | 91 | $this->em->flush(); |
| 92 | 92 | $output->writeln('<info>Cleanup finished</info>'); |
| 93 | 93 | } |
@@ -103,13 +103,13 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | private function prepareArchive() |
| 105 | 105 | { |
| 106 | - $archiveDir = $this->getContainer()->get('kernel')->getRootDir() . '/logs/'; |
|
| 107 | - $header = $this->getApplication()->getName() . ' ' . $this->getApplication()->getVersion() . ', running a cleanup'; |
|
| 106 | + $archiveDir = $this->getContainer()->get('kernel')->getRootDir().'/logs/'; |
|
| 107 | + $header = $this->getApplication()->getName().' '.$this->getApplication()->getVersion().', running a cleanup'; |
|
| 108 | 108 | |
| 109 | - $this->archiveFile = $archiveDir . 'overwatch_archive_' . date('YmdHis') . '.log'; |
|
| 110 | - $this->output->writeln(' > Preparing archive file <info>' . $this->archiveFile . '</info>'); |
|
| 109 | + $this->archiveFile = $archiveDir.'overwatch_archive_'.date('YmdHis').'.log'; |
|
| 110 | + $this->output->writeln(' > Preparing archive file <info>'.$this->archiveFile.'</info>'); |
|
| 111 | 111 | |
| 112 | - if (!file_put_contents($this->archiveFile, $header . PHP_EOL, FILE_APPEND)) { |
|
| 112 | + if (!file_put_contents($this->archiveFile, $header.PHP_EOL, FILE_APPEND)) { |
|
| 113 | 113 | throw new \InvalidArgumentException('Could not write to the archive file.'); |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | return; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - $this->output->writeln(' > Finding results older than <info>' . $delete->format('Y-m-d H:i:s') . '</info> to delete'); |
|
| 126 | + $this->output->writeln(' > Finding results older than <info>'.$delete->format('Y-m-d H:i:s').'</info> to delete'); |
|
| 127 | 127 | $resultsToCleanup = $this->resultRepo->getResultsOlderThan($delete); |
| 128 | 128 | |
| 129 | 129 | foreach ($resultsToCleanup as $row) { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $lastResult = ResultStatus::PASSED; |
| 146 | - $this->output->writeln(' > Finding results older than <info>' . $compress->format('Y-m-d H:i:s') . '</info> to compress'); |
|
| 146 | + $this->output->writeln(' > Finding results older than <info>'.$compress->format('Y-m-d H:i:s').'</info> to compress'); |
|
| 147 | 147 | $resultsToCleanup = $this->resultRepo->getResultsOlderThan($compress); |
| 148 | 148 | |
| 149 | 149 | foreach ($resultsToCleanup as $row) { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | private function archiveResult(TestResult $result) |
| 161 | 161 | { |
| 162 | 162 | if ($this->archiveFile !== null) { |
| 163 | - file_put_contents($this->archiveFile, (string) $result . PHP_EOL, FILE_APPEND); |
|
| 163 | + file_put_contents($this->archiveFile, (string) $result.PHP_EOL, FILE_APPEND); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $this->em->remove($result); |