1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-09 05:30:40 +02:00

Move media type detection methods to abstract class

This commit is contained in:
Oliver Vogel
2024-01-27 17:58:55 +01:00
parent 6dcc450eee
commit 19578de8d4
5 changed files with 85 additions and 27 deletions

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
use Intervention\Image\Drivers\Gd\Decoders\AbstractDecoder;
use Intervention\Image\Tests\TestCase;
use Mockery;
class AbstractDecoderTest extends TestCase
{
public function testGetMediaTypeFromFilePath(): void
{
$decoder = Mockery::mock(AbstractDecoder::class)->makePartial();
$this->assertEquals('image/jpeg', $decoder->getMediaTypeByFilePath($this->getTestImagePath('test.jpg')));
}
public function testGetMediaTypeFromFileBinary(): void
{
$decoder = Mockery::mock(AbstractDecoder::class)->makePartial();
$this->assertEquals('image/jpeg', $decoder->getMediaTypeByBinary($this->getTestImageData('test.jpg')));
}
}