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()); }
/** * @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()); }
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); }