/** * @param CommandInterface $command * @param string $tube * @param int $priority * @param int $delay * @param int $timeToRun * @throws Exception */ public function queue(CommandInterface $command, $tube = Beanie::DEFAULT_TUBE, $priority = Beanie::DEFAULT_PRIORITY, $delay = Beanie::DEFAULT_DELAY, $timeToRun = Beanie::DEFAULT_TIME_TO_RUN) { try { $this->producer->useTube($tube)->put($this->serializer->serialize($command), $priority, $delay, $timeToRun); } catch (Exception $exception) { $this->handlePutFailure($exception, $command); } }
public function testUse_onlyUpdatesTubeStatus() { /** @var \PHPUnit_Framework_MockObject_MockObject|Pool $poolMock */ $poolMock = $this->getMockBuilder(Pool::class)->disableOriginalConstructor()->setMethods(['dispatchCommand'])->getMock(); $poolMock->expects($this->never())->method('dispatchCommand'); $producer = new Producer($poolMock); $producer->useTube('TEST-TUBE'); $this->assertEquals('TEST-TUBE', $producer->getTubeStatus()->getCurrentTube()); }