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:
24
tests/Drivers/Gd/Decoders/AbstractDecoderTest.php
Normal file
24
tests/Drivers/Gd/Decoders/AbstractDecoderTest.php
Normal 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')));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user