mirror of
https://github.com/Intervention/image.git
synced 2025-08-07 22:36:54 +02:00
Fix bitmap detection in tests
This commit is contained in:
@@ -305,8 +305,8 @@ class ImageTest extends TestCase
|
||||
|
||||
public function testToBitmap(): void
|
||||
{
|
||||
$this->assertMediaType('image/x-ms-bmp', (string) $this->image->toBitmap());
|
||||
$this->assertMediaType('image/x-ms-bmp', (string) $this->image->toBmp());
|
||||
$this->assertMediaTypeBitmap((string) $this->image->toBitmap());
|
||||
$this->assertMediaTypeBitmap((string) $this->image->toBmp());
|
||||
}
|
||||
|
||||
public function testToAvif(): void
|
||||
|
@@ -298,8 +298,8 @@ class ImageTest extends TestCase
|
||||
|
||||
public function testToBitmap(): void
|
||||
{
|
||||
$this->assertMediaType('image/x-ms-bmp', (string) $this->image->toBitmap());
|
||||
$this->assertMediaType('image/x-ms-bmp', (string) $this->image->toBmp());
|
||||
$this->assertMediaTypeBitmap((string) $this->image->toBitmap());
|
||||
$this->assertMediaTypeBitmap((string) $this->image->toBmp());
|
||||
}
|
||||
|
||||
public function testToAvif(): void
|
||||
|
@@ -44,4 +44,27 @@ abstract class TestCase extends MockeryTestCase
|
||||
$allowed = is_string($allowed) ? [$allowed] : $allowed;
|
||||
$this->assertTrue(in_array($detected, $allowed));
|
||||
}
|
||||
|
||||
protected function assertMediaTypeBitmap(string $input): void
|
||||
{
|
||||
$this->assertMediaType([
|
||||
'image/x-ms-bmp',
|
||||
'image/bmp',
|
||||
'bmp',
|
||||
'ms-bmp',
|
||||
'x-bitmap',
|
||||
'x-bmp',
|
||||
'x-ms-bmp',
|
||||
'x-win-bitmap',
|
||||
'x-windows-bmp',
|
||||
'x-xbitmap',
|
||||
'image/ms-bmp',
|
||||
'image/x-bitmap',
|
||||
'image/x-bmp',
|
||||
'image/x-ms-bmp',
|
||||
'image/x-win-bitmap',
|
||||
'image/x-windows-bmp',
|
||||
'image/x-xbitmap',
|
||||
], $input);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user