public function testBury_dispatchesBuryCommand_usesPriority() { $serverMock = $this->getServerMock(['dispatchCommand']); $priority = 99; $serverMock->expects($this->once())->method('dispatchCommand')->with($this->callback(function (CommandInterface $command) use($priority) { return $command->getCommandLine() === sprintf('%s %s %s', CommandInterface::COMMAND_BURY, self::TEST_ID, $priority); }))->willReturn($this->_getResponseOathMock()); $job = new Job(self::TEST_ID, null, $serverMock); $job->bury($priority); $this->assertEquals(Job::STATE_BURIED, $job->getState()); }
/** * @param int $priority * @return $this */ public function bury($priority = Beanie::DEFAULT_PRIORITY) { $this->job->bury($priority); return $this; }