$image_reloaded =
$this->imageFactory->
get($file_path);
$this->
assertInstanceOf(\GDImage::
class,
$image_reloaded->
getToolkit()->
getResource());
} /**
* @covers ::getSupportedExtensions
* @covers ::extensionToImageType
*/
public function testSupportedExtensions(): void
{ // Test the list of supported extensions.
$expected_extensions =
['png', 'gif', 'jpeg', 'jpg', 'jpe', 'webp'
];
$this->
assertEqualsCanonicalizing($expected_extensions,
$this->imageFactory->
getSupportedExtensions());
// Test that the supported extensions map to correct internal GD image
// types.
$expected_image_types =
[ 'png' => IMAGETYPE_PNG,
'gif' => IMAGETYPE_GIF,
'jpeg' => IMAGETYPE_JPEG,
'jpg' => IMAGETYPE_JPEG,
'jpe' => IMAGETYPE_JPEG,
'webp' => IMAGETYPE_WEBP,
];