mirror of
https://github.com/Intervention/image.git
synced 2025-08-30 17:19:50 +02:00
Change signature of internal methods
The following internal methods now return enum MediaType instead of string. Intervention\Image\AbstractDecoder::getMediaTypeByFilePath() Intervention\Image\AbstractDecoder::getMediaTypeByBinary()
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace Intervention\Image\Tests\Unit\Drivers\Gd\Decoders;
|
||||
|
||||
use Intervention\Image\Drivers\Gd\Decoders\AbstractDecoder;
|
||||
use Intervention\Image\MediaType;
|
||||
use Intervention\Image\Tests\BaseTestCase;
|
||||
use Mockery;
|
||||
|
||||
@@ -13,12 +14,18 @@ final class AbstractDecoderTest extends BaseTestCase
|
||||
public function testGetMediaTypeFromFilePath(): void
|
||||
{
|
||||
$decoder = Mockery::mock(AbstractDecoder::class)->makePartial();
|
||||
$this->assertEquals('image/jpeg', $decoder->getMediaTypeByFilePath($this->getTestResourcePath('test.jpg')));
|
||||
$this->assertEquals(
|
||||
MediaType::IMAGE_JPEG,
|
||||
$decoder->getMediaTypeByFilePath($this->getTestResourcePath('test.jpg'))
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetMediaTypeFromFileBinary(): void
|
||||
{
|
||||
$decoder = Mockery::mock(AbstractDecoder::class)->makePartial();
|
||||
$this->assertEquals('image/jpeg', $decoder->getMediaTypeByBinary($this->getTestResourceData('test.jpg')));
|
||||
$this->assertEquals(
|
||||
MediaType::IMAGE_JPEG,
|
||||
$decoder->getMediaTypeByBinary($this->getTestResourceData('test.jpg')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user