Example #1
0
 public function getData()
 {
     $delivery = new FilesystemDelivery();
     $delivery->setTarget('/path/to/Target');
     /**
      * @todo add receipts
      */
     $receipts = array();
     $image = new ImageJob();
     $image->setEnd(microtime(true))->setDeliveryDuration(25.4)->setDelivery($delivery)->setError(true)->setErrorMessage('An error ploped')->setParameters(array('param1' => 'val1', 'param2' => 'val2'))->setProcessDuration(23.42)->setWorkerId('a worker-id')->setSource('/path/to/source')->setReceipts($receipts);
     $video = new VideoJob();
     $image->setEnd(microtime(true))->setDeliveryDuration(25.4)->setDelivery($delivery)->setError(true)->setErrorMessage('An error ploped')->setParameters(array('param1' => 'val1', 'param2' => 'val2'))->setProcessDuration(23.42)->setWorkerId('a worker-id')->setSource('/path/to/source')->setReceipts($receipts);
     return array(array($image, $image->toJson()), array($video, $video->toJson()));
 }
Example #2
0
 public function getData()
 {
     $delivery = new FilesystemDelivery();
     $delivery->setTarget('/path/to/Target');
     /**
      * @todo add receipts
      */
     $receipts = array();
     $image = new ImageJob();
     $image->setEnd(microtime(true))->setDeliveryDuration(25.4)->setDelivery($delivery)->setError(true)->setErrorMessage('An error ploped')->setParameters(array('param1' => 'val1', 'param2' => 'val2'))->setProcessDuration(23.42)->setWorkerId('a worker-id')->setSource('/path/to/source')->setReceipts($receipts);
     $video = new VideoJob();
     $image->setEnd(microtime(true))->setDeliveryDuration(25.4)->setDelivery($delivery)->setError(true)->setErrorMessage('An error ploped')->setParameters(array('param1' => 'val1', 'param2' => 'val2'))->setProcessDuration(23.42)->setWorkerId('a worker-id')->setSource('/path/to/source')->setReceipts($receipts);
     $presence = new WorkerPresence();
     $presence->setWorkerType('worker-type')->setFailureJobs(mt_rand())->setId(mt_rand())->setMemory(123456789)->setStartedTime(223456789.98765433)->setLastJobTime(333456789.9876543)->setTotalJobs(mt_rand())->setSuccessJobs(mt_rand())->setReportTime(444456789.98765445)->setIdle(true);
     return array(array($image, $image->toJson()), array($video, $video->toJson()), array($presence, $presence->toJson()));
 }
 public function testCreateJob()
 {
     $delivery = $this->getMockBuilder('Gloubster\\Delivery\\DeliveryInterface')->disableOriginalConstructor()->getMock();
     $job = VideoJob::create('/path/to/source', $delivery);
     $this->assertTrue($job->isOk());
 }