mirror of
https://github.com/Intervention/image.git
synced 2025-08-17 19:26:25 +02:00
added Image::mime()
This commit is contained in:
@@ -223,6 +223,16 @@ class Image extends File
|
|||||||
return $this->getSize()->height;
|
return $this->getSize()->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads mime type
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function mime()
|
||||||
|
{
|
||||||
|
return $this->mime;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns encoded image data in string conversion
|
* Returns encoded image data in string conversion
|
||||||
*
|
*
|
||||||
|
@@ -51,6 +51,12 @@ class ImageTest extends PHPUnit_Framework_TestCase
|
|||||||
$image->filter($demoFilter);
|
$image->filter($demoFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testMime()
|
||||||
|
{
|
||||||
|
$image = $this->getTestImage();
|
||||||
|
$this->assertEquals('image/png', $image->mime());
|
||||||
|
}
|
||||||
|
|
||||||
private function getTestImage()
|
private function getTestImage()
|
||||||
{
|
{
|
||||||
$size = Mockery::mock('\Intervention\Image\Size', array(800, 600));
|
$size = Mockery::mock('\Intervention\Image\Size', array(800, 600));
|
||||||
@@ -60,6 +66,7 @@ class ImageTest extends PHPUnit_Framework_TestCase
|
|||||||
$command->shouldReceive('getOutput')->andReturn('mock');
|
$command->shouldReceive('getOutput')->andReturn('mock');
|
||||||
$driver->shouldReceive('executeCommand')->andReturn($command);
|
$driver->shouldReceive('executeCommand')->andReturn($command);
|
||||||
$image = new Image($driver, 'mock');
|
$image = new Image($driver, 'mock');
|
||||||
|
$image->mime = 'image/png';
|
||||||
|
|
||||||
return $image;
|
return $image;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user