public function QueueWorkerLockedTest::testUploadLockedQueueAcquireLockAndProcess in TMGMT Extension Suite 8.3
Upload queue worker: lock acquired and queue item is processed.
File
- tests/
src/ Kernel/ QueueWorkerLockedTest.php, line 103
Class
- QueueWorkerLockedTest
- Tests locked queues.
Namespace
Drupal\Tests\tmgmt_extension_suit\KernelCode
public function testUploadLockedQueueAcquireLockAndProcess() {
$lockId = get_class($this->uploadQueueWorker) . ':processItem';
$this->uploadQueueWorker
->expects($this
->once())
->method('doProcessItem')
->with([
"foo" => "bar",
]);
$this->lockMock
->expects($this
->once())
->method('acquire')
->with($lockId, 27)
->willReturn(TRUE);
$this->lockMock
->expects($this
->once())
->method('release');
$this->uploadQueueWorker
->processItem([
"foo" => "bar",
]);
}