Ejemplo n.º 1
0
 public function getDeliveries()
 {
     $amazon = AmazonS3::create('bucket', 'object', array(), 'public', 24);
     $filesystem = Filesystem::create('/path/to/target');
     return array(array($amazon, $amazon->toArray()), array($filesystem, $filesystem->toArray()));
 }
Ejemplo n.º 2
0
 public function getJob()
 {
     $job = new VideoJob();
     return $job->setSource(__DIR__ . '/../../../../testfiles/photo02.JPG')->setDelivery(Filesystem::create(__DIR__ . '/../../../../target.jpg'));
 }
Ejemplo n.º 3
0
 public function getDelivery()
 {
     $this->target = tempnam(sys_get_temp_dir(), 'test_filesystem_delivery');
     return Filesystem::create($this->target);
 }
Ejemplo n.º 4
0
 public function testWithOptions()
 {
     $parameters = array('width' => 320, 'height' => 240, 'format' => 'gif', 'resize-mode' => ImageJob::RESIZE_INBOUND, 'resolution-units' => ImageJob::RESOLUTION_PER_CENTIMETERS, 'resolution' => 200, 'strip' => true, 'rotation' => 90, 'quality' => 100);
     $job = ImageJob::create(__DIR__ . '/../../../testfiles/photo02.JPG', Filesystem::create($this->target), $parameters);
     $message = $this->getAMQPMessage($job->toJson());
     $this->getWorker()->process($message);
     $this->assertTrue(file_exists($this->target));
 }
Ejemplo n.º 5
0
 public function getJob()
 {
     $job = new ImageJob();
     return $job->setSource(__DIR__ . '/../../../../testfiles/photo02.JPG')->setDelivery(Filesystem::create(__DIR__ . '/../../../../target.jpg'))->setParameters(array('format' => 'png'));
 }
Ejemplo n.º 6
0
 public function testProcessWithWrongJobType()
 {
     $job = $this->getWrongJob(Filesystem::create($this->target));
     $this->assertTrue($job->isOk());
     $json = $job->toJson();
     $data = json_decode($json, true);
     $data['type'] = 'Gloubster\\Message\\Job\\ImageJob';
     $json = json_encode($data);
     $message = $this->getAMQPMessage($json);
     $channel = $this->getChannel();
     $this->ensureAcknowledgement($channel, $message->delivery_info['delivery_tag']);
     $this->probePublishValues($channel, false, Configuration::ROUTINGKEY_LOG);
     try {
         $this->getWorker($channel)->process($message);
         $this->fail('Should have raised an exception');
     } catch (RuntimeException $e) {
     }
 }