/**
  * Marks a job as failed and deletes it from the beanstalk tube
  *
  * @param WorkPackage $task
  * @param string $log
  * @throws TaskQueueServiceException
  * @return void
  */
 public function markFailed(WorkPackage $task, $log)
 {
     if ($this->logWorkerOutputOnFailure) {
         $this->updateTaskLog($task, $log);
     }
     $this->updateTaskStatus($task, Task::STATUS_FAILED);
     $this->beanstalk->delete($task->getPheanstalkJob());
 }
 /**
  * @return void
  */
 public function testIfUseTubeWrapsProperly()
 {
     $this->pheanstalk->shouldReceive('useTube')->with('tube')->once();
     $return = $this->connection->useTube('tube');
     $this->assertEquals($this->connection, $return, 'Return should be the same as the connection');
 }