function CronSuspendQueueDelayTest::setUpWorker
Initializes a queue worker mock object.
Return value
\Drupal\Core\Queue\QueueWorkerInterface&\PHPUnit\Framework\MockObject\MockObject The mocked queue worker.
3 calls to CronSuspendQueueDelayTest::setUpWorker()
- CronSuspendQueueDelayTest::testSuspendQueue in core/
tests/ Drupal/ Tests/ Core/ Cron/ CronSuspendQueueDelayTest.php - Tests a queue is reprocessed again after other queues.
- CronSuspendQueueDelayTest::testSuspendQueueOrder in core/
tests/ Drupal/ Tests/ Core/ Cron/ CronSuspendQueueDelayTest.php - Tests queues are executed in order.
- CronSuspendQueueDelayTest::testSuspendQueueThreshold in core/
tests/ Drupal/ Tests/ Core/ Cron/ CronSuspendQueueDelayTest.php - Tests queues may be re-processed by whether delay exceeds threshold.
File
-
core/
tests/ Drupal/ Tests/ Core/ Cron/ CronSuspendQueueDelayTest.php, line 86
Class
- CronSuspendQueueDelayTest
- Test Cron handling of suspended queues with a delay.
Namespace
Drupal\Tests\Core\CronCode
protected function setUpWorker() : QueueWorkerInterface&MockObject {
$worker = $this->createMock(QueueWorkerInterface::class);
$worker->method('getPluginDefinition')
->willReturn([
'cron' => [
'time' => 300,
],
]);
return $worker;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.