@@ -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 | } |
@@ -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); |
@@ -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 | } |
@@ -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 |
@@ -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"])) { |
@@ -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) |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | try { |
97 | 97 | $this->expectationManager->get($test->getExpectation()); |
98 | 98 | } catch (ExpectationNotFoundException $ex) { |
99 | - return new JsonResponse("Expectation '" . $test->getExpectation() . "' could not be found", JsonResponse::HTTP_UNPROCESSABLE_ENTITY); |
|
99 | + return new JsonResponse("Expectation '".$test->getExpectation()."' could not be found", JsonResponse::HTTP_UNPROCESSABLE_ENTITY); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if ($test->getActual() === null) { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | foreach (['name', 'actual', 'expectation', 'expected'] as $field) { |
162 | 162 | if ($request->request->has($field)) { |
163 | - $test->{'set' . ucfirst($field)}($request->request->get($field)); |
|
163 | + $test->{'set'.ucfirst($field)}($request->request->get($field)); |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | public function testGetGroup() |
113 | 113 | { |
114 | 114 | $this->logIn('ROLE_SUPER_ADMIN'); |
115 | - $this->client->request('GET', '/api/groups/' . TestGroupFixtures::$groups['group-1']->getId()); |
|
115 | + $this->client->request('GET', '/api/groups/'.TestGroupFixtures::$groups['group-1']->getId()); |
|
116 | 116 | |
117 | 117 | $this->assertJsonResponse($this->client->getResponse()); |
118 | 118 | $this->assertJsonStringEqualsJsonString( |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | public function testGetGroupInsufficentPerms() |
127 | 127 | { |
128 | 128 | $this->logIn('ROLE_ADMIN'); |
129 | - $this->client->request('GET', '/api/groups/' . TestGroupFixtures::$groups['group-1']->getId()); |
|
129 | + $this->client->request('GET', '/api/groups/'.TestGroupFixtures::$groups['group-1']->getId()); |
|
130 | 130 | |
131 | 131 | $this->assertForbidden($this->client->getResponse()); |
132 | 132 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $this->logIn('ROLE_SUPER_ADMIN'); |
147 | 147 | $this->makeJsonRequest( |
148 | 148 | 'PUT', |
149 | - '/api/groups/' . TestGroupFixtures::$groups['group-2']->getId(), |
|
149 | + '/api/groups/'.TestGroupFixtures::$groups['group-2']->getId(), |
|
150 | 150 | [ |
151 | 151 | 'name' => $newName |
152 | 152 | ] |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | public function testUpdateGroupInsufficentPerms() |
167 | 167 | { |
168 | 168 | $this->logIn('ROLE_USER'); |
169 | - $this->client->request('PUT', '/api/groups/' . TestGroupFixtures::$groups['group-2']->getId()); |
|
169 | + $this->client->request('PUT', '/api/groups/'.TestGroupFixtures::$groups['group-2']->getId()); |
|
170 | 170 | |
171 | 171 | $this->assertForbidden($this->client->getResponse()); |
172 | 172 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function testDeleteGroup() |
183 | 183 | { |
184 | 184 | $this->logIn('ROLE_SUPER_ADMIN'); |
185 | - $this->client->request('DELETE', '/api/groups/' . TestGroupFixtures::$groups['group-3']->getId()); |
|
185 | + $this->client->request('DELETE', '/api/groups/'.TestGroupFixtures::$groups['group-3']->getId()); |
|
186 | 186 | |
187 | 187 | $this->assertEquals(Response::HTTP_NO_CONTENT, $this->client->getResponse()->getStatusCode()); |
188 | 188 | $this->assertNull($this->em->find("Overwatch\TestBundle\Entity\TestGroup", TestGroupFixtures::$groups['group-3']->getId())); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | public function testDeleteGroupPopulatedGroup() |
192 | 192 | { |
193 | 193 | $this->logIn('ROLE_SUPER_ADMIN'); |
194 | - $this->client->request('DELETE', '/api/groups/' . TestGroupFixtures::$groups['group-2']->getId()); |
|
194 | + $this->client->request('DELETE', '/api/groups/'.TestGroupFixtures::$groups['group-2']->getId()); |
|
195 | 195 | |
196 | 196 | $this->assertEquals(Response::HTTP_UNPROCESSABLE_ENTITY, $this->client->getResponse()->getStatusCode()); |
197 | 197 | $this->assertNotNull($this->em->find("Overwatch\TestBundle\Entity\TestGroup", TestGroupFixtures::$groups['group-2']->getId())); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | public function testDeleteGroupInsufficentPerms() |
201 | 201 | { |
202 | 202 | $this->logIn('ROLE_ADMIN'); |
203 | - $this->client->request('DELETE', '/api/groups/' . TestGroupFixtures::$groups['group-3']->getId()); |
|
203 | + $this->client->request('DELETE', '/api/groups/'.TestGroupFixtures::$groups['group-3']->getId()); |
|
204 | 204 | |
205 | 205 | $this->assertForbidden($this->client->getResponse()); |
206 | 206 | $this->assertNotNull($this->em->find("Overwatch\TestBundle\Entity\TestGroup", TestGroupFixtures::$groups['group-2']->getId())); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $group = TestGroupFixtures::$groups['group-3']; |
221 | 221 | |
222 | 222 | $this->logIn('ROLE_SUPER_ADMIN'); |
223 | - $this->client->request('POST', '/api/groups/' . $group->getId() . '/user/' . $user->getId()); |
|
223 | + $this->client->request('POST', '/api/groups/'.$group->getId().'/user/'.$user->getId()); |
|
224 | 224 | |
225 | 225 | $group = $this->em->find("Overwatch\TestBundle\Entity\TestGroup", $group->getId()); |
226 | 226 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $group = TestGroupFixtures::$groups['group-3']; |
236 | 236 | |
237 | 237 | $this->logIn('ROLE_ADMIN'); |
238 | - $this->client->request('POST', '/api/groups/' . $group->getId() . '/user/' . $user->getId()); |
|
238 | + $this->client->request('POST', '/api/groups/'.$group->getId().'/user/'.$user->getId()); |
|
239 | 239 | |
240 | 240 | $group = $this->em->find("Overwatch\TestBundle\Entity\TestGroup", $group->getId()); |
241 | 241 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $user = UserFixtures::$users['user-2']; |
249 | 249 | |
250 | 250 | $this->logIn('ROLE_SUPER_ADMIN'); |
251 | - $this->client->request('POST', '/api/groups/1000/user/' . $user->getId()); |
|
251 | + $this->client->request('POST', '/api/groups/1000/user/'.$user->getId()); |
|
252 | 252 | |
253 | 253 | $this->assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode()); |
254 | 254 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $group = TestGroupFixtures::$groups['group-3']; |
259 | 259 | |
260 | 260 | $this->logIn('ROLE_SUPER_ADMIN'); |
261 | - $this->client->request('POST', '/api/groups/' . $group->getId() . '/user/1000'); |
|
261 | + $this->client->request('POST', '/api/groups/'.$group->getId().'/user/1000'); |
|
262 | 262 | |
263 | 263 | $group = $this->em->find("Overwatch\TestBundle\Entity\TestGroup", $group->getId()); |
264 | 264 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $group = TestGroupFixtures::$groups['group-1']; |
273 | 273 | |
274 | 274 | $this->logIn('ROLE_SUPER_ADMIN'); |
275 | - $this->client->request('DELETE', '/api/groups/' . $group->getId() . '/user/' . $user->getId()); |
|
275 | + $this->client->request('DELETE', '/api/groups/'.$group->getId().'/user/'.$user->getId()); |
|
276 | 276 | |
277 | 277 | $group = $this->em->find("Overwatch\TestBundle\Entity\TestGroup", $group->getId()); |
278 | 278 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $group = TestGroupFixtures::$groups['group-1']; |
288 | 288 | |
289 | 289 | $this->logIn('ROLE_ADMIN'); |
290 | - $this->client->request('DELETE', '/api/groups/' . $group->getId() . '/user/' . $user->getId()); |
|
290 | + $this->client->request('DELETE', '/api/groups/'.$group->getId().'/user/'.$user->getId()); |
|
291 | 291 | |
292 | 292 | $group = $this->em->find("Overwatch\TestBundle\Entity\TestGroup", $group->getId()); |
293 | 293 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | $group = TestGroupFixtures::$groups['group-1']; |
302 | 302 | |
303 | 303 | $this->logIn('ROLE_SUPER_ADMIN'); |
304 | - $this->client->request('DELETE', '/api/groups/1000/user/' . $user->getId()); |
|
304 | + $this->client->request('DELETE', '/api/groups/1000/user/'.$user->getId()); |
|
305 | 305 | |
306 | 306 | $group = $this->em->find("Overwatch\TestBundle\Entity\TestGroup", $group->getId()); |
307 | 307 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $group = TestGroupFixtures::$groups['group-1']; |
315 | 315 | |
316 | 316 | $this->logIn('ROLE_SUPER_ADMIN'); |
317 | - $this->client->request('DELETE', '/api/groups/' . $group->getId() . '/user/1000'); |
|
317 | + $this->client->request('DELETE', '/api/groups/'.$group->getId().'/user/1000'); |
|
318 | 318 | |
319 | 319 | $group = $this->em->find("Overwatch\TestBundle\Entity\TestGroup", $group->getId()); |
320 | 320 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->logIn('ROLE_SUPER_ADMIN'); |
27 | 27 | $this->makeJsonRequest( |
28 | 28 | 'POST', |
29 | - '/api/tests/group/' . TestGroupFixtures::$groups['group-2']->getId(), |
|
29 | + '/api/tests/group/'.TestGroupFixtures::$groups['group-2']->getId(), |
|
30 | 30 | [ |
31 | 31 | 'name' => $newTest->getName(), |
32 | 32 | 'actual' => $newTest->getActual(), |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function testCreateTestInsufficentPerms() |
53 | 53 | { |
54 | 54 | $this->logIn('ROLE_USER'); |
55 | - $this->client->request('POST', '/api/tests/group/' . TestGroupFixtures::$groups['group-1']->getId()); |
|
55 | + $this->client->request('POST', '/api/tests/group/'.TestGroupFixtures::$groups['group-1']->getId()); |
|
56 | 56 | |
57 | 57 | $this->assertForbidden($this->client->getResponse()); |
58 | 58 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->logIn('ROLE_SUPER_ADMIN'); |
70 | 70 | $this->makeJsonRequest( |
71 | 71 | 'POST', |
72 | - '/api/tests/group/' . TestGroupFixtures::$groups['group-2']->getId(), |
|
72 | + '/api/tests/group/'.TestGroupFixtures::$groups['group-2']->getId(), |
|
73 | 73 | [ |
74 | 74 | 'name' => $newTest->getName(), |
75 | 75 | 'actual' => $newTest->getActual(), |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->logIn('ROLE_SUPER_ADMIN'); |
98 | 98 | $this->makeJsonRequest( |
99 | 99 | 'POST', |
100 | - '/api/tests/group/' . TestGroupFixtures::$groups['group-2']->getId(), |
|
100 | + '/api/tests/group/'.TestGroupFixtures::$groups['group-2']->getId(), |
|
101 | 101 | [ |
102 | 102 | 'name' => $newTest->getName(), |
103 | 103 | 'expectation' => $newTest->getExpectation() |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function testGetTestsInGroup() |
116 | 116 | { |
117 | 117 | $this->logIn('ROLE_SUPER_ADMIN'); |
118 | - $this->client->request('GET', '/api/tests/group/' . TestGroupFixtures::$groups['group-1']->getId()); |
|
118 | + $this->client->request('GET', '/api/tests/group/'.TestGroupFixtures::$groups['group-1']->getId()); |
|
119 | 119 | |
120 | 120 | $this->assertJsonResponse($this->client->getResponse()); |
121 | 121 | $this->assertCount(2, $this->getResponseContent()); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | public function testGetTestsInGroupInsufficentPerms() |
133 | 133 | { |
134 | 134 | $this->logIn('ROLE_ADMIN'); |
135 | - $this->client->request('GET', '/api/tests/group/' . TestGroupFixtures::$groups['group-1']->getId()); |
|
135 | + $this->client->request('GET', '/api/tests/group/'.TestGroupFixtures::$groups['group-1']->getId()); |
|
136 | 136 | |
137 | 137 | $this->assertForbidden($this->client->getResponse()); |
138 | 138 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | public function testGetTest() |
149 | 149 | { |
150 | 150 | $this->logIn('ROLE_SUPER_ADMIN'); |
151 | - $this->client->request('GET', '/api/tests/' . TestFixtures::$tests['test-1']->getId()); |
|
151 | + $this->client->request('GET', '/api/tests/'.TestFixtures::$tests['test-1']->getId()); |
|
152 | 152 | |
153 | 153 | $this->assertJsonResponse($this->client->getResponse()); |
154 | 154 | $this->assertJsonStringEqualsJsonString( |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | public function testGetTestInsufficentPerms() |
163 | 163 | { |
164 | 164 | $this->logIn('ROLE_ADMIN'); |
165 | - $this->client->request('GET', '/api/tests/' . TestFixtures::$tests['test-1']->getId()); |
|
165 | + $this->client->request('GET', '/api/tests/'.TestFixtures::$tests['test-1']->getId()); |
|
166 | 166 | |
167 | 167 | $this->assertForbidden($this->client->getResponse()); |
168 | 168 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $this->logIn('ROLE_SUPER_ADMIN'); |
183 | 183 | $this->makeJsonRequest( |
184 | 184 | 'PUT', |
185 | - '/api/tests/' . TestFixtures::$tests['test-1']->getId(), |
|
185 | + '/api/tests/'.TestFixtures::$tests['test-1']->getId(), |
|
186 | 186 | [ |
187 | 187 | 'name' => $newName |
188 | 188 | ] |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | public function testUpdateTestInsufficentPerms() |
203 | 203 | { |
204 | 204 | $this->logIn('ROLE_USER'); |
205 | - $this->client->request('PUT', '/api/tests/' . TestFixtures::$tests['test-1']->getId()); |
|
205 | + $this->client->request('PUT', '/api/tests/'.TestFixtures::$tests['test-1']->getId()); |
|
206 | 206 | |
207 | 207 | $this->assertForbidden($this->client->getResponse()); |
208 | 208 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | public function testDeleteTest() |
219 | 219 | { |
220 | 220 | $this->logIn('ROLE_SUPER_ADMIN'); |
221 | - $this->client->request('DELETE', '/api/tests/' . TestFixtures::$tests['test-1']->getId()); |
|
221 | + $this->client->request('DELETE', '/api/tests/'.TestFixtures::$tests['test-1']->getId()); |
|
222 | 222 | |
223 | 223 | $this->assertTrue($this->client->getResponse()->isSuccessful()); |
224 | 224 | $this->assertEquals(Response::HTTP_NO_CONTENT, $this->client->getResponse()->getStatusCode()); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | public function testDeleteTestInsufficentPerms() |
229 | 229 | { |
230 | 230 | $this->logIn('ROLE_USER'); |
231 | - $this->client->request('DELETE', '/api/tests/' . TestFixtures::$tests['test-1']->getId()); |
|
231 | + $this->client->request('DELETE', '/api/tests/'.TestFixtures::$tests['test-1']->getId()); |
|
232 | 232 | |
233 | 233 | $this->assertForbidden($this->client->getResponse()); |
234 | 234 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | public function testRunTest() |
245 | 245 | { |
246 | 246 | $this->logIn('ROLE_SUPER_ADMIN'); |
247 | - $this->client->request('POST', '/api/tests/' . TestFixtures::$tests['test-1']->getId()); |
|
247 | + $this->client->request('POST', '/api/tests/'.TestFixtures::$tests['test-1']->getId()); |
|
248 | 248 | |
249 | 249 | $test = $this->em->find("Overwatch\TestBundle\Entity\Test", TestFixtures::$tests['test-1']->getId()); |
250 | 250 | |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | public function testRunTestInsufficentPerms() |
259 | 259 | { |
260 | 260 | $this->logIn('ROLE_USER'); |
261 | - $this->client->request('POST', '/api/tests/' . TestFixtures::$tests['test-1']->getId()); |
|
261 | + $this->client->request('POST', '/api/tests/'.TestFixtures::$tests['test-1']->getId()); |
|
262 | 262 | |
263 | 263 | $this->assertForbidden($this->client->getResponse()); |
264 | 264 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | $field = strtolower($field); |
74 | 74 | |
75 | 75 | if ($value === null) { |
76 | - $value = TestFixtures::$tests['test-1']->{'get' . ucfirst($field)}(); |
|
76 | + $value = TestFixtures::$tests['test-1']->{'get'.ucfirst($field)}(); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | if ($field === 'expectation') { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $command = new TestsRunCommand(); |
34 | 34 | $command->setContainer($this->getContainer()); |
35 | 35 | |
36 | - $this->application = new Application('Overwatch', '0.0.1-test.' . time()); |
|
36 | + $this->application = new Application('Overwatch', '0.0.1-test.'.time()); |
|
37 | 37 | $this->application->add($command); |
38 | 38 | |
39 | 39 | $this->command = new CommandTester($command); |
@@ -69,13 +69,13 @@ discard block |
||
69 | 69 | $this->assertCountLinesOfOutput(5); |
70 | 70 | |
71 | 71 | $this->assertHasStandardOutput(); |
72 | - $this->assertStringStartsWith(' > ' . TestFixtures::$tests['test-1'] . ' : PASSED - Pinged in ', $this->output[1]); |
|
72 | + $this->assertStringStartsWith(' > '.TestFixtures::$tests['test-1'].' : PASSED - Pinged in ', $this->output[1]); |
|
73 | 73 | $this->assertRegExp('/0\.[0-9]+s$/', $this->output[1]); |
74 | 74 | |
75 | - $this->assertStringStartsWith(' > ' . TestFixtures::$tests['test-2'] . ' : PASSED - Pinged in ', $this->output[2]); |
|
75 | + $this->assertStringStartsWith(' > '.TestFixtures::$tests['test-2'].' : PASSED - Pinged in ', $this->output[2]); |
|
76 | 76 | $this->assertRegExp('/0\.[0-9]+s$/', $this->output[2]); |
77 | 77 | |
78 | - $this->assertStringStartsWith(' > ' . TestFixtures::$tests['test-3'] . ' : PASSED - Pinged in ', $this->output[3]); |
|
78 | + $this->assertStringStartsWith(' > '.TestFixtures::$tests['test-3'].' : PASSED - Pinged in ', $this->output[3]); |
|
79 | 79 | $this->assertRegExp('/0\.[0-9]+s$/', $this->output[3]); |
80 | 80 | |
81 | 81 | $this->assertCountRunTests(); |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | |
150 | 150 | $this->assertHasStandardOutput(); |
151 | 151 | |
152 | - $this->assertStringStartsWith(' > ' . TestFixtures::$tests['test-2'] . ' : UNSATISFACTORY - ', $this->output[1]); |
|
152 | + $this->assertStringStartsWith(' > '.TestFixtures::$tests['test-2'].' : UNSATISFACTORY - ', $this->output[1]); |
|
153 | 153 | $this->assertRegExp('/responded in 1\.[0-9]+ s, above the unsatisfactory threshold \(1 s\)$/', $this->output[1]); |
154 | 154 | |
155 | - $this->assertStringStartsWith(' > ' . TestFixtures::$tests['test-3'] . ' : FAILED - ', $this->output[2]); |
|
155 | + $this->assertStringStartsWith(' > '.TestFixtures::$tests['test-3'].' : FAILED - ', $this->output[2]); |
|
156 | 156 | $this->assertStringEndsWith('failed to respond in the timeout threshold (2 s)', $this->output[2]); |
157 | 157 | |
158 | 158 | |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | |
176 | 176 | $this->assertHasStandardOutput(); |
177 | 177 | |
178 | - $this->assertStringStartsWith(' > ' . TestFixtures::$tests['test-1'] . ' : PASSED - Pinged in ', $this->output[1]); |
|
178 | + $this->assertStringStartsWith(' > '.TestFixtures::$tests['test-1'].' : PASSED - Pinged in ', $this->output[1]); |
|
179 | 179 | $this->assertRegExp('/0\.[0-9]+s$/', $this->output[1]); |
180 | 180 | |
181 | - $this->assertStringStartsWith(' > ' . TestFixtures::$tests['test-2'] . ' : UNSATISFACTORY - ', $this->output[2]); |
|
181 | + $this->assertStringStartsWith(' > '.TestFixtures::$tests['test-2'].' : UNSATISFACTORY - ', $this->output[2]); |
|
182 | 182 | $this->assertRegExp('/responded in 1\.[0-9]+ s, above the unsatisfactory threshold \(1 s\)$/', $this->output[2]); |
183 | 183 | |
184 | - $this->assertStringStartsWith(' > ' . TestFixtures::$tests['test-3'] . ' : FAILED - ', $this->output[3]); |
|
184 | + $this->assertStringStartsWith(' > '.TestFixtures::$tests['test-3'].' : FAILED - ', $this->output[3]); |
|
185 | 185 | $this->assertStringEndsWith('failed to respond in the timeout threshold (2 s)', $this->output[3]); |
186 | 186 | |
187 | 187 |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | throw new \InvalidArgumentException('Could not find any tests to run.'); |
71 | 71 | } |
72 | 72 | |
73 | - $output->writeln($this->getApplication()->getLongVersion() . ', running <info>' . count($tests) . '</info> tests'); |
|
73 | + $output->writeln($this->getApplication()->getLongVersion().', running <info>'.count($tests).'</info> tests'); |
|
74 | 74 | |
75 | 75 | foreach ($tests as $test) { |
76 | 76 | $result = $this->expectations->run($test); |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | //Don't output if we're not running verbosely and the test passes. |
80 | 80 | if ($result->getStatus() !== ResultStatus::PASSED || $output->isVerbose()) { |
81 | 81 | $output->writeln( |
82 | - ' > ' . $test->getName() . ' : ' . |
|
83 | - $this->getColouredStatus($result->getStatus()) . |
|
84 | - ' - ' . $result->getInfo() |
|
82 | + ' > '.$test->getName().' : '. |
|
83 | + $this->getColouredStatus($result->getStatus()). |
|
84 | + ' - '.$result->getInfo() |
|
85 | 85 | ); |
86 | 86 | } |
87 | 87 | $this->_em->persist($result); |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | if ($value === null) { |
105 | 105 | $value = $status; |
106 | 106 | } else { |
107 | - $value .= ' ' . $status; |
|
107 | + $value .= ' '.$status; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | ResultStatus::isValid($status); |
111 | - return '<' . $this->colours[$status] . '>' . $value . '</' . $this->colours[$status] . '>'; |
|
111 | + return '<'.$this->colours[$status].'>'.$value.'</'.$this->colours[$status].'>'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | $summary = ''; |
122 | 122 | |
123 | 123 | foreach (ResultStatus::getAll() as $status) { |
124 | - $summary .= $this->getColouredStatus($status, $this->results[$status]) . ', '; |
|
124 | + $summary .= $this->getColouredStatus($status, $this->results[$status]).', '; |
|
125 | 125 | } |
126 | 126 | |
127 | - $summary .= 'in ' . $runTime->i . ' minutes and ' . $runTime->s . ' seconds'; |
|
127 | + $summary .= 'in '.$runTime->i.' minutes and '.$runTime->s.' seconds'; |
|
128 | 128 | return $summary; |
129 | 129 | } |
130 | 130 | } |