Example #1
0
 public function testType()
 {
     $key = 'Foo';
     $adapter = Mockery::mock(self::$fileAdapterInterface);
     $imagine = Mockery::mock(self::$abstractImagine);
     $sut = new Image($key, $adapter, $imagine);
     $this->assertEquals(Image::TYPE_MEDIA_FILE_IMAGE, $sut->getMediaType());
 }
Example #2
0
 /**
  * @param $key
  * @param LocalFileAdapterInterface $adapter
  */
 public function flipVertically($key, LocalFileAdapterInterface $adapter)
 {
     $target = new Image($key, $adapter, $this->imagine);
     $this->imagine->open($this->getPath())->flipVertically()->save($target->getPath());
 }
Example #3
0
 public function testGmagickFlipVerticaly()
 {
     if (!extension_loaded('gmagick')) {
         return;
     }
     $imagine = new \Imagine\Gmagick\Imagine();
     $key = 'test-236x315.jpg';
     $targetKey = 'gmagick-flip-vertically-' . $key;
     $mediaManager = new Manager();
     $sourceAdapter = new LocalFileAdapter(__DIR__ . '/../../Data/');
     $targetAdapter = new LocalFileAdapter(__DIR__ . '/../../Temp/');
     $sut = new \Derby\Media\LocalFile\Image($key, $sourceAdapter, $imagine);
     if ($mediaManager->exists($targetKey, $targetAdapter)) {
         $targetAdapter->delete($targetKey);
     }
     $sut->flipVertically($targetKey, $targetAdapter);
 }