| @@ 8-21 (lines=14) @@ | ||
| 5 | use Heri\Bundle\JobQueueBundle\Tests\TestCase; |
|
| 6 | use Heri\Bundle\JobQueueBundle\Command\QueueFlushCommand; |
|
| 7 | ||
| 8 | class QueueFlushCommandTest extends TestCase |
|
| 9 | { |
|
| 10 | public function testExecute() |
|
| 11 | { |
|
| 12 | $application = new Application($this->kernel); |
|
| 13 | $application->add(new QueueFlushCommand()); |
|
| 14 | ||
| 15 | $command = $application->find('jobqueue:flush'); |
|
| 16 | $commandTester = new CommandTester($command); |
|
| 17 | $commandTester->execute(array('command' => $command->getName())); |
|
| 18 | ||
| 19 | $this->assertRegExp('/Cleaned exceptions/', $commandTester->getDisplay()); |
|
| 20 | } |
|
| 21 | } |
|
| 22 | ||
| @@ 8-21 (lines=14) @@ | ||
| 5 | use Heri\Bundle\JobQueueBundle\Tests\TestCase; |
|
| 6 | use Heri\Bundle\JobQueueBundle\Command\QueueWorkCommand; |
|
| 7 | ||
| 8 | class QueueListenCommandTest extends TestCase |
|
| 9 | { |
|
| 10 | public function testExecute() |
|
| 11 | { |
|
| 12 | $application = new Application($this->kernel); |
|
| 13 | $application->add(new QueueWorkCommand()); |
|
| 14 | ||
| 15 | $command = $application->find('jobqueue:work'); |
|
| 16 | $commandTester = new CommandTester($command); |
|
| 17 | $commandTester->execute(array('command' => $command->getName())); |
|
| 18 | ||
| 19 | $this->assertRegExp('/Handling the first job on the queue.../', $commandTester->getDisplay()); |
|
| 20 | } |
|
| 21 | } |
|
| 22 | ||
| @@ 8-24 (lines=17) @@ | ||
| 5 | use Heri\Bundle\JobQueueBundle\Tests\TestCase; |
|
| 6 | use Heri\Bundle\JobQueueBundle\Command\QueueShowCommand; |
|
| 7 | ||
| 8 | class QueueShowCommandTest extends TestCase |
|
| 9 | { |
|
| 10 | public function testExecute() |
|
| 11 | { |
|
| 12 | $application = new Application($this->kernel); |
|
| 13 | $application->add(new QueueShowCommand()); |
|
| 14 | ||
| 15 | $command = $application->find('jobqueue:show'); |
|
| 16 | $commandTester = new CommandTester($command); |
|
| 17 | $commandTester->execute(array( |
|
| 18 | 'command' => $command->getName(), |
|
| 19 | 'queue-name' => 'toto', |
|
| 20 | )); |
|
| 21 | ||
| 22 | $this->assertRegExp('/| id | body | created | ended | failed |/', $commandTester->getDisplay()); |
|
| 23 | } |
|
| 24 | } |
|
| 25 | ||