public function testGetHandledMessages(): void
{ static::
assertEquals([InvalidateCacheTask::
class], InvalidateCacheTaskHandler::
getHandledMessages());
} public function testRunWithoutDelay(): void
{ $cacheInvalidator =
$this->
createMock(CacheInvalidator::
class);
$cacheInvalidator->
expects(static::
once())->
method('invalidateExpired'
)->
with(null
);
$handler =
new InvalidateCacheTaskHandler($this->
createMock(EntityRepository::
class),
$cacheInvalidator, 0
);
$handler->
run();
} public function testRunWithDelay(): void
{ $cacheInvalidator =
$this->
createMock(CacheInvalidator::
class);
$cacheInvalidator->
expects(static::
once())->
method('invalidateExpired'
);
$handler =
new InvalidateCacheTaskHandler($this->
createMock(EntityRepository::
class),
$cacheInvalidator, 300
);
$handler->
run();
}