createMock(QueueProcessor::class); $processor->expects(self::once())->method('process')->with(10, 50); $scopeConfig = $this->createMock(ScopeConfigInterface::class); $scopeConfig->method('getValue')->willReturnCallback( static fn(string $path): string => str_ends_with($path, 'tasks_per_run') ? '10' : '50' ); (new CronConsumer($processor, $scopeConfig))->execute(); } public function testClampsQueueLimitsToAllowedRange(): void { $processor = $this->createMock(QueueProcessor::class); $processor->expects(self::once())->method('process')->with(50, 10); $scopeConfig = $this->createMock(ScopeConfigInterface::class); $scopeConfig->method('getValue')->willReturnCallback( static fn(string $path): string => str_ends_with($path, 'tasks_per_run') ? '999' : '1' ); (new CronConsumer($processor, $scopeConfig))->execute(); } }