function CronQueueTest::testDatabaseQueueReturnTypes
Same name in other branches
- 9 core/modules/system/tests/src/Kernel/System/CronQueueTest.php \Drupal\Tests\system\Kernel\System\CronQueueTest::testDatabaseQueueReturnTypes()
- 10 core/modules/system/tests/src/Kernel/System/CronQueueTest.php \Drupal\Tests\system\Kernel\System\CronQueueTest::testDatabaseQueueReturnTypes()
Tests that database queue implementation complies with interfaces specs.
File
-
core/
modules/ system/ tests/ src/ Kernel/ System/ CronQueueTest.php, line 283
Class
- CronQueueTest
- Tests the Cron Queue runner.
Namespace
Drupal\Tests\system\Kernel\SystemCode
public function testDatabaseQueueReturnTypes() : void {
/** @var \Drupal\Core\Queue\DatabaseQueue $queue */
$queue = $this->container
->get('queue')
->get('cron_queue_test_database_delay_exception');
static::assertInstanceOf(DatabaseQueue::class, $queue);
$queue->createItem(12);
$item = $queue->claimItem();
static::assertTrue($queue->delayItem($item, 1));
static::assertTrue($queue->releaseItem($item));
$queue->deleteItem($item);
static::assertFalse($queue->delayItem($item, 1));
static::assertFalse($queue->releaseItem($item));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.