function CronQueueTest::testRequeueException
Tests requeue exception is handled properly.
@covers \Drupal\Core\Queue\RequeueException
      
    
See also
\Drupal\cron_queue_test\Plugin\QueueWorker\CronQueueTestRequeueException
File
- 
              core/
modules/ system/ tests/ src/ Kernel/ System/ CronQueueTest.php, line 270  
Class
- CronQueueTest
 - Tests the Cron Queue runner.
 
Namespace
Drupal\Tests\system\Kernel\SystemCode
public function testRequeueException() : void {
  // Test the requeueing functionality.
  $queue = $this->container
    ->get('queue')
    ->get(CronQueueTestRequeueException::PLUGIN_ID);
  $queue->createItem([]);
  $this->cron
    ->run();
  $this->assertEquals(2, \Drupal::state()->get('cron_queue_test_requeue_exception'));
  $this->assertEquals(0, $queue->numberOfItems());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.