/** * @test */ public function stoppWorkWhenMemoryExceeds() { $queueName = 'test' . uniqid(); $timeout = 3; $memoryLimit = 123; $this->extensionConfiguration->expects($this->any())->method('get')->with('memoryLimit')->will($this->returnValue($memoryLimit)); $job = new TestJob(); $this->jobManager->expects($this->once())->method('waitAndExecute')->with($queueName, $timeout)->will($this->returnValue($job)); $this->worker->expects($this->any())->method('memoryExceeded')->with($memoryLimit)->will($this->returnValue(true)); $this->worker->work($queueName, $timeout, Worker::LIMIT_QUEUE); }