示例#1
0
 /** @test */
 public function itShouldWork()
 {
     $job = ImageJob::create('/path/to/source', new DeliveryMock(), array('format' => 'jpeg'));
     $logger = $this->getLogger();
     $logger->expects($this->never())->method('addError');
     $logger->expects($this->never())->method('addInfo');
     $client = $this->getStompClient();
     $client->expects($this->once())->method('isConnected')->will($this->returnValue(true));
     $handler = new MessageHandler($client, $logger);
     $handler->receive($job->toJson());
 }
示例#2
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));
 }
示例#3
0
 public function testCreateJob()
 {
     $delivery = $this->getMockBuilder('Gloubster\\Delivery\\DeliveryInterface')->disableOriginalConstructor()->getMock();
     $job = ImageJob::create('/path/to/source', $delivery, array('format' => 'bingo'));
     $this->assertTrue($job->isOk());
 }