-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix invalid format MIME type definition (#835)
- Loading branch information
Showing
6 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Imagine package. | ||
* | ||
* (c) Bulat Shakirzyanov <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Imagine\Test\Image; | ||
|
||
use Imagine\Image\Format; | ||
use Imagine\Test\ImagineTestCase; | ||
|
||
class FormatTest extends ImagineTestCase | ||
{ | ||
public function formatIdMimeTypeProvider() | ||
{ | ||
return array( | ||
array(Format::ID_JPEG, 'image/jpeg'), | ||
array(Format::ID_WBMP, 'image/vnd.wap.wbmp'), | ||
array(Format::ID_AVIF, 'image/avif'), | ||
array(Format::ID_WEBP, 'image/webp'), | ||
); | ||
} | ||
|
||
/** | ||
* @dataProvider formatIdMimeTypeProvider | ||
* | ||
* @param string $formatId | ||
* @param string $expectedMimeType | ||
*/ | ||
public function testMimeTypes($formatId, $expectedMimeType) | ||
{ | ||
$format = Format::get($formatId); | ||
|
||
$this->assertEquals($format->getMimeType(), $expectedMimeType); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters