public function setUp() { $this->mockQueueManager = $this->getMockBuilder(QueueManager::class)->disableOriginalConstructor()->getMock(); $this->testQueue = new TestQueue('TestQueue'); $this->mockQueueManager->expects($this->any())->method('getQueue')->with('TestQueue')->will($this->returnValue($this->testQueue)); $this->jobManager = new JobManager(); $this->inject($this->jobManager, 'queueManager', $this->mockQueueManager); }
public function setUp() { parent::setUp(); $this->mockQueueManager = $this->getMockBuilder(QueueManager::class)->disableOriginalConstructor()->getMock(); $this->testQueue = new TestQueue('TestQueue'); $this->mockQueueManager->expects($this->any())->method('getQueue')->with('TestQueue')->will($this->returnValue($this->testQueue)); $this->mockQueueManager->expects($this->any())->method('getQueueSettings')->with('TestQueue')->will($this->returnCallback(function () { return $this->queueSettings; })); $this->jobManager = new JobManager(); $this->inject($this->jobManager, 'queueManager', $this->mockQueueManager); self::$bootstrap->getSignalSlotDispatcher()->connect(JobManager::class, 'messageSubmitted', $this, 'logSignal'); self::$bootstrap->getSignalSlotDispatcher()->connect(JobManager::class, 'messageTimeout', $this, 'logSignal'); self::$bootstrap->getSignalSlotDispatcher()->connect(JobManager::class, 'messageReserved', $this, 'logSignal'); self::$bootstrap->getSignalSlotDispatcher()->connect(JobManager::class, 'messageFinished', $this, 'logSignal'); self::$bootstrap->getSignalSlotDispatcher()->connect(JobManager::class, 'messageReleased', $this, 'logSignal'); self::$bootstrap->getSignalSlotDispatcher()->connect(JobManager::class, 'messageFailed', $this, 'logSignal'); }