1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-01 11:30:16 +02:00

added Image::mime()

This commit is contained in:
Oliver Vogel
2014-05-16 17:24:14 +02:00
parent 9aa12a3f08
commit 6a8fb9507d
2 changed files with 17 additions and 0 deletions

View File

@@ -223,6 +223,16 @@ class Image extends File
return $this->getSize()->height;
}
/**
* Reads mime type
*
* @return string
*/
public function mime()
{
return $this->mime;
}
/**
* Returns encoded image data in string conversion
*

View File

@@ -51,6 +51,12 @@ class ImageTest extends PHPUnit_Framework_TestCase
$image->filter($demoFilter);
}
public function testMime()
{
$image = $this->getTestImage();
$this->assertEquals('image/png', $image->mime());
}
private function getTestImage()
{
$size = Mockery::mock('\Intervention\Image\Size', array(800, 600));
@@ -60,6 +66,7 @@ class ImageTest extends PHPUnit_Framework_TestCase
$command->shouldReceive('getOutput')->andReturn('mock');
$driver->shouldReceive('executeCommand')->andReturn($command);
$image = new Image($driver, 'mock');
$image->mime = 'image/png';
return $image;
}