| @@ 60-76 (lines=17) @@ | ||
| 57 | $this->assertEquals('ok', file_get_contents(__DIR__.'/../Fixtures/app/cache/cron_result.log')); |
|
| 58 | } |
|
| 59 | ||
| 60 | private function createScanCommandTester(ContainerInterface $container, $extraCommands = []) |
|
| 61 | { |
|
| 62 | $application = new Application(); |
|
| 63 | $application->setAutoExit(false); |
|
| 64 | ||
| 65 | $command = new CronScanCommand(); |
|
| 66 | $command->setContainer($container); |
|
| 67 | ||
| 68 | foreach ($extraCommands as $extraCommand) { |
|
| 69 | $extraCommand->setContainer($container); |
|
| 70 | $application->add($extraCommand); |
|
| 71 | } |
|
| 72 | ||
| 73 | $application->add($command); |
|
| 74 | ||
| 75 | return new CommandTester($application->find('cron:scan')); |
|
| 76 | } |
|
| 77 | ||
| 78 | private function createRunCommandTester(ContainerInterface $container, $extraCommands = []) |
|
| 79 | { |
|
| @@ 78-94 (lines=17) @@ | ||
| 75 | return new CommandTester($application->find('cron:scan')); |
|
| 76 | } |
|
| 77 | ||
| 78 | private function createRunCommandTester(ContainerInterface $container, $extraCommands = []) |
|
| 79 | { |
|
| 80 | $application = new Application(); |
|
| 81 | $application->setAutoExit(false); |
|
| 82 | ||
| 83 | $command = new CronRunCommand(); |
|
| 84 | $command->setContainer($container); |
|
| 85 | ||
| 86 | foreach ($extraCommands as $extraCommand) { |
|
| 87 | $extraCommand->setContainer($container); |
|
| 88 | $application->add($extraCommand); |
|
| 89 | } |
|
| 90 | ||
| 91 | $application->add($command); |
|
| 92 | ||
| 93 | return new CommandTester($application->find('cron:run')); |
|
| 94 | } |
|
| 95 | } |
|
| 96 | ||
| @@ 54-70 (lines=17) @@ | ||
| 51 | $this->assertNotNull($command, 'Can\'t find newly created command in database'); |
|
| 52 | } |
|
| 53 | ||
| 54 | private function createCommandTester(ContainerInterface $container, $extraCommands = []) |
|
| 55 | { |
|
| 56 | $application = new Application(); |
|
| 57 | $application->setAutoExit(false); |
|
| 58 | ||
| 59 | $command = new CronScanCommand(); |
|
| 60 | $command->setContainer($container); |
|
| 61 | ||
| 62 | foreach ($extraCommands as $extraCommand) { |
|
| 63 | $extraCommand->setContainer($container); |
|
| 64 | $application->add($extraCommand); |
|
| 65 | } |
|
| 66 | ||
| 67 | $application->add($command); |
|
| 68 | ||
| 69 | return new CommandTester($application->find('cron:scan')); |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||