mirror of
https://github.com/Intervention/image.git
synced 2025-01-17 12:18:14 +01:00
Fix bitmap detection in tests
This commit is contained in:
parent
86ab920897
commit
5f7b98772a
@ -305,8 +305,8 @@ class ImageTest extends TestCase
|
|||||||
|
|
||||||
public function testToBitmap(): void
|
public function testToBitmap(): void
|
||||||
{
|
{
|
||||||
$this->assertMediaType('image/x-ms-bmp', (string) $this->image->toBitmap());
|
$this->assertMediaTypeBitmap((string) $this->image->toBitmap());
|
||||||
$this->assertMediaType('image/x-ms-bmp', (string) $this->image->toBmp());
|
$this->assertMediaTypeBitmap((string) $this->image->toBmp());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testToAvif(): void
|
public function testToAvif(): void
|
||||||
|
@ -298,8 +298,8 @@ class ImageTest extends TestCase
|
|||||||
|
|
||||||
public function testToBitmap(): void
|
public function testToBitmap(): void
|
||||||
{
|
{
|
||||||
$this->assertMediaType('image/x-ms-bmp', (string) $this->image->toBitmap());
|
$this->assertMediaTypeBitmap((string) $this->image->toBitmap());
|
||||||
$this->assertMediaType('image/x-ms-bmp', (string) $this->image->toBmp());
|
$this->assertMediaTypeBitmap((string) $this->image->toBmp());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testToAvif(): void
|
public function testToAvif(): void
|
||||||
|
@ -44,4 +44,27 @@ abstract class TestCase extends MockeryTestCase
|
|||||||
$allowed = is_string($allowed) ? [$allowed] : $allowed;
|
$allowed = is_string($allowed) ? [$allowed] : $allowed;
|
||||||
$this->assertTrue(in_array($detected, $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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user