@@ -180,6 +180,9 @@ |
||
| 180 | 180 | }); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | + /** |
|
| 184 | + * @param integer $count |
|
| 185 | + */ |
|
| 183 | 186 | private function assertFinishedRunningCountOperations($count) |
| 184 | 187 | { |
| 185 | 188 | $this->assertEquals(" > Applying $count cleanup operations", $this->output[count($this->output) - 2]); |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | $this->archive = []; |
| 171 | 171 | |
| 172 | 172 | $mock = $this->getFunctionMock('Overwatch\ResultBundle\Command', 'file_put_contents'); |
| 173 | - $mock->expects($this->any())->willReturnCallback(function ($file, $contents, $mode) { |
|
| 173 | + $mock->expects($this->any())->willReturnCallback(function($file, $contents, $mode) { |
|
| 174 | 174 | $this->assertRegExp('/overwatch_archive_[0-9]{14}.log/i', $file); |
| 175 | 175 | $this->assertStringEndsWith(PHP_EOL, $contents); |
| 176 | 176 | $this->assertEquals(FILE_APPEND, $mode); |
@@ -5,10 +5,10 @@ |
||
| 5 | 5 | use Overwatch\TestBundle\Command\TestsRunCommand; |
| 6 | 6 | use Overwatch\TestBundle\DataFixtures\ORM\TestFixtures; |
| 7 | 7 | use Overwatch\UserBundle\Tests\Base\DatabaseAwareTestCase; |
| 8 | -use phpmock\phpunit\PHPMock; |
|
| 9 | 8 | use Symfony\Component\Console\Application; |
| 10 | 9 | use Symfony\Component\Console\Output\Output; |
| 11 | 10 | use Symfony\Component\Console\Tester\CommandTester; |
| 11 | +use phpmock\phpunit\PHPMock; |
|
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * TestsRunCommandTest |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | { |
| 210 | 210 | $mock = $this->getFunctionMock('Overwatch\ServiceBundle\Expectation', 'socket_read'); |
| 211 | 211 | |
| 212 | - $mock->expects($this->any())->willReturnCallback(function () { |
|
| 212 | + $mock->expects($this->any())->willReturnCallback(function() { |
|
| 213 | 213 | usleep(rand(500, 300000)); //Sleep randomly between 0.0005 and 0.3s |
| 214 | 214 | return true; |
| 215 | 215 | }); |
@@ -220,9 +220,9 @@ discard block |
||
| 220 | 220 | $mock = $this->getFunctionMock('Overwatch\ServiceBundle\Expectation', 'socket_read'); |
| 221 | 221 | |
| 222 | 222 | $mock->expects($this->any())->willReturnOnConsecutiveCalls( |
| 223 | - $this->returnCallback(function () { usleep(500); return true; }), |
|
| 224 | - $this->returnCallback(function () { usleep(1000500); return true; }), |
|
| 225 | - $this->returnCallback(function () { usleep(1000500); return true; }), |
|
| 223 | + $this->returnCallback(function() { usleep(500); return true; }), |
|
| 224 | + $this->returnCallback(function() { usleep(1000500); return true; }), |
|
| 225 | + $this->returnCallback(function() { usleep(1000500); return true; }), |
|
| 226 | 226 | $this->returnValue(false) |
| 227 | 227 | ); |
| 228 | 228 | } |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | break; |
| 83 | 83 | |
| 84 | 84 | case 'delayed': |
| 85 | - $mock->expects($this->once())->willReturnCallback(function () { |
|
| 85 | + $mock->expects($this->once())->willReturnCallback(function() { |
|
| 86 | 86 | usleep(210000); |
| 87 | 87 | return true; |
| 88 | 88 | }); |
@@ -182,7 +182,7 @@ |
||
| 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())); |
@@ -85,9 +85,9 @@ |
||
| 85 | 85 | { |
| 86 | 86 | if ($this->webDriver !== null) { |
| 87 | 87 | if (in_array($this->getStatus(), [\PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE, \PHPUnit_Runner_BaseTestRunner::STATUS_ERROR])) { |
| 88 | - echo PHP_EOL.PHP_EOL.PHP_EOL; |
|
| 89 | - echo 'data:image/png;base64,'.base64_encode($this->webDriver->takeScreenshot()); |
|
| 90 | - echo PHP_EOL.PHP_EOL.PHP_EOL; |
|
| 88 | + echo PHP_EOL . PHP_EOL . PHP_EOL; |
|
| 89 | + echo 'data:image/png;base64,' . base64_encode($this->webDriver->takeScreenshot()); |
|
| 90 | + echo PHP_EOL . PHP_EOL . PHP_EOL; |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |