Пример #1
0
 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());
 }
Пример #2
0
 /**
  * @param int $priority
  * @return $this
  */
 public function bury($priority = Beanie::DEFAULT_PRIORITY)
 {
     $this->job->bury($priority);
     return $this;
 }