public function testGetFormat() { $pathList = array(DIR_TEST_DATA . 'img/test.jpg' => CM_Image_Image::FORMAT_JPEG, DIR_TEST_DATA . 'img/test.gif' => CM_Image_Image::FORMAT_GIF, DIR_TEST_DATA . 'img/test.png' => CM_Image_Image::FORMAT_PNG, DIR_TEST_DATA . 'img/corrupt-content.jpg' => CM_Image_Image::FORMAT_JPEG); foreach ($pathList as $path => $format) { $imageFile = new CM_File($path); $image = new CM_Image_Image($imageFile->read()); $this->assertSame($format, $image->getFormat()); } $svgImage = CM_Image_Image::createFromSVG((new CM_File(DIR_TEST_DATA . 'img/favicon.svg'))->read(), 100, 100); $this->assertSame(CM_Image_Image::FORMAT_SVG, $svgImage->getFormat()); }