1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 04:08:14 +01:00

Fix bitmap detection in tests

This commit is contained in:
Oliver Vogel 2024-01-16 16:49:24 +01:00
parent 86ab920897
commit 5f7b98772a
3 changed files with 27 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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);
}
}