1 system.test CronQueueTestCase::testCallable()

Tests worker defined as a class method callable.

File

core/modules/system/tests/system.test, line 829
Tests for system.module.

Class

CronQueueTestCase
Test execution of the cron queue.

Code

function testCallable() {
  $queue = BackdropQueue::get('cron_queue_test_callback');

  // Enqueue an item for processing.
  $queue->createItem(array($this->randomName() => $this->randomName()));

  // Run cron; the worker should perform the task and delete the item from the
  // queue.
  $this->cronRun();

  // The queue should be empty.
  $this->assertEqual($queue->numberOfItems(), 0);
}