Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output = new SymfonyStyle($input, $output);
     $queue = $this->queueFactory->createQueue($input->getArgument('queue'));
     //        if ($input->isInteractive()) {
     //            if (!$output->confirm(sprintf('you sure?', $queue->getName()), false)) {
     //                return;
     //            }
     //        }
     $this->queueRegistry->register($queue);
     // @todo should this be here?
     $job = new Job($input->getArgument('target'));
     // @todo remove new Job.
     if ($queue->enqueue($job)) {
         $output->success('Enqueued job "' . $job->getJobClass() . '" with arguments, to queue "' . $queue->getName() . '"');
     }
 }
Ejemplo n.º 2
0
 public function testAllReturnsRegisteredQueues()
 {
     return $this->markTestIncomplete();
     $queues = $this->registry->all();
     $this->assertCount(0, $queues);
     $foo = $this->registry->createQueue('foo');
     $this->registry->register($foo);
     $queues = $this->registry->all();
     $this->assertCount(1, $queues);
     $this->assertEquals('foo', $queues['foo']);
     $bar = $this->registry->createQueue('bar');
     $this->registry->register($bar);
     $queues = $this->registry->all();
     $this->assertCount(2, $queues);
     $this->assertNotContains($foo, $queues);
     $this->assertNotContains($bar, $queues);
 }