public function ToolkitImagemagickTest::testImagemagickMimeTypeMapperDeprecation in ImageMagick 8.2
Test deprecation of ImagemagickMimeTypeMapper.
@group legacy
@expectedDeprecation The Drupal\imagemagick\ImagemagickMimeTypeMapper class is deprecated in ImageMagick 8.x-2.4, will be removed in 8.x-3.0. You should use the FileEye\MimeMap\Type and FileEye\MimeMap\Extension API instead. See https://www.drupal.org/project/imagemagick/issues/3026733. @expectedDeprecation Drupal\imagemagick\ImagemagickMimeTypeMapper::getExtensionsForMimeType is deprecated in ImageMagick 8.x-2.4, will be removed in 8.x-3.0. Use FileEye\MimeMap\Type::getExtensions() instead. See https://www.drupal.org/project/imagemagick/issues/3026733. @expectedDeprecation Drupal\imagemagick\ImagemagickMimeTypeMapper::getMimeTypes is deprecated in ImageMagick 8.x-2.4, will be removed in 8.x-3.0. Use FileEye\MimeMap\AbstractMap::listTypes() instead. See https://www.drupal.org/project/imagemagick/issues/3026733.
File
- tests/
src/ Functional/ ToolkitImagemagickTest.php, line 1013
Class
- ToolkitImagemagickTest
- Tests that core image manipulations work properly through Imagemagick.
Namespace
Drupal\Tests\imagemagick\FunctionalCode
public function testImagemagickMimeTypeMapperDeprecation() {
$mime_type_mapper = \Drupal::service('imagemagick.mime_type_mapper');
$format_extensions = $mime_type_mapper
->getExtensionsForMimeType('image/jpeg');
$this
->assertEquals([
'jpe',
'jpeg',
'jpg',
], $format_extensions);
$this
->assertNotEmpty($mime_type_mapper
->getMimeTypes());
}