protected function DatabaseBackendTest::rewindTime in Advanced Queue 8
Changes the current time.
Parameters
int $new_time: The new time.
3 calls to DatabaseBackendTest::rewindTime()
- DatabaseBackendTest::testFutureQueue in tests/
src/ Kernel/ DatabaseBackendTest.php - @covers ::enqueueJob @covers ::claimJob
- DatabaseBackendTest::testQueue in tests/
src/ Kernel/ DatabaseBackendTest.php - @covers ::deleteQueue @covers ::countJobs @covers ::enqueueJob @covers ::enqueueJobs @covers ::claimJob @covers ::onSuccess @covers ::onFailure @covers ::deleteJob
- DatabaseBackendTest::testQueueCleanup in tests/
src/ Kernel/ DatabaseBackendTest.php - @covers ::cleanupQueue
File
- tests/
src/ Kernel/ DatabaseBackendTest.php, line 231
Class
- DatabaseBackendTest
- @coversDefaultClass \Drupal\advancedqueue\Plugin\AdvancedQueue\Backend\Database @group advancedqueue
Namespace
Drupal\Tests\advancedqueue\KernelCode
protected function rewindTime($new_time) {
$mock_time = $this
->prophesize(TimeInterface::class);
$mock_time
->getCurrentTime()
->willReturn($new_time);
$this->container
->set('datetime.time', $mock_time
->reveal());
// Reload the queues so that their backends get the updated service.
$storage = $this->container
->get('entity_type.manager')
->getStorage('advancedqueue_queue');
$storage
->resetCache([
'first_queue',
'second_queue',
]);
$this->firstQueue = $storage
->load('first_queue');
$this->secondQueue = $storage
->load('second_queue');
}